From b4e83f440dd7b9697c48170d37b0c4828e134439 Mon Sep 17 00:00:00 2001 From: Maxime ROBERT Date: Thu, 18 Jun 2015 15:35:34 +0200 Subject: [PATCH] =?UTF-8?q?doc:=20Document=20include/str=5Flist.h=20Fixes:?= =?UTF-8?q?=20#12050.=20Signed-off-by:=20Claire=20MASSOT=20=20Signed-off-by:=20Jordan=20DORNE=20=20Signed-off-by:=20K=C3=A9vin=20CARADANT=20=20Signed-off-by:=20Gabriel=20SENTUCQ=20=20Signed-off-by:=20Maxime=20ROBERT=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/str_list.h | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/include/str_list.h b/src/include/str_list.h index 83a0e64e135..4ba0cadd960 100644 --- a/src/include/str_list.h +++ b/src/include/str_list.h @@ -7,22 +7,77 @@ #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())