X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Finclude%2Fstr_list.h;fp=src%2Fceph%2Fsrc%2Finclude%2Fstr_list.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=8ca07f3d31bb6bfa12494580ac261e28610e117a;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/include/str_list.h b/src/ceph/src/include/str_list.h deleted file mode 100644 index 8ca07f3..0000000 --- a/src/ceph/src/include/str_list.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef CEPH_STRLIST_H -#define CEPH_STRLIST_H - -#include -#include -#include -#include - -/** - * Split **str** into a list of strings, using the ";,= \t" delimiters and output the result in **str_list**. - * - * @param [in] str String to split and save as list - * @param [out] str_list List modified containing str after it has been split -**/ -extern void get_str_list(const std::string& str, - std::list& str_list); - -/** - * Split **str** into a list of strings, using the **delims** delimiters and output the result in **str_list**. - * - * @param [in] str String to split and save as list - * @param [in] delims characters used to split **str** - * @param [out] str_list List modified containing str after it has been split -**/ -extern void get_str_list(const std::string& str, - const char *delims, - std::list& str_list); - -/** - * Split **str** into a list of strings, using the ";,= \t" delimiters and output the result in **str_vec**. - * - * @param [in] str String to split and save as Vector - * @param [out] str_vec Vector modified containing str after it has been split -**/ -extern void get_str_vec(const std::string& str, - std::vector& str_vec); - -/** - * Split **str** into a list of strings, using the **delims** delimiters and output the result in **str_vec**. - * - * @param [in] str String to split and save as Vector - * @param [in] delims characters used to split **str** - * @param [out] str_vec Vector modified containing str after it has been split -**/ -extern void get_str_vec(const std::string& str, - const char *delims, - std::vector& str_vec); - -/** - * Split **str** into a list of strings, using the ";,= \t" delimiters and output the result in **str_list**. - * - * @param [in] str String to split and save as Set - * @param [out] str_list Set modified containing str after it has been split -**/ -extern void get_str_set(const std::string& str, - std::set& str_list); - -/** - * Split **str** into a list of strings, using the **delims** delimiters and output the result in **str_list**. - * - * @param [in] str String to split and save as Set - * @param [in] delims characters used to split **str** - * @param [out] str_list Set modified containing str after it has been split -**/ -extern void get_str_set(const std::string& str, - const char *delims, - std::set& str_list); - -/** - * Return a String containing the vector **v** joined with **sep** - * - * If **v** is empty, the function returns an empty string - * For each element in **v**, - * it will concatenate this element and **sep** with result - * - * @param [in] v Vector to join as a String - * @param [in] sep String used to join each element from **v** - * @return empty string if **v** is empty or concatenated string -**/ -inline std::string str_join(const std::vector& v, std::string sep) -{ - if (v.empty()) - return std::string(); - std::vector::const_iterator i = v.begin(); - std::string r = *i; - for (++i; i != v.end(); ++i) { - r += sep; - r += *i; - } - return r; -} - -static inline std::vector get_str_vec(const std::string& str) -{ - std::vector str_vec; - const char *delims = ";,= \t"; - get_str_vec(str, delims, str_vec); - return str_vec; -} - -#endif