Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
join.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * tlx/string/join.hpp
3  *
4  * Part of tlx - http://panthema.net/tlx
5  *
6  * Copyright (C) 2007-2017 Timo Bingmann <[email protected]>
7  *
8  * All rights reserved. Published under the Boost Software License, Version 1.0
9  ******************************************************************************/
10 
11 #ifndef TLX_STRING_JOIN_HEADER
12 #define TLX_STRING_JOIN_HEADER
13 
14 #include <string>
15 #include <vector>
16 
17 namespace tlx {
18 
19 //! \addtogroup tlx_string
20 //! \{
21 
22 /******************************************************************************/
23 // join()
24 
25 /*!
26  * Join a vector of strings by some glue character between each pair from the
27  * sequence.
28  *
29  * \param glue character for glue
30  * \param parts the vector of strings to join
31  * \return string constructed from the vector with the glue between two strings
32  */
34  char glue, const std::vector<std::string>& parts);
35 
36 /*!
37  * Join a vector of strings by some glue string between each pair from the
38  * sequence.
39  *
40  * \param glue string to glue
41  * \param parts the vector of strings to join
42  * \return string constructed from the vector with the glue between two strings
43  */
45  const char* glue, const std::vector<std::string>& parts);
46 
47 /*!
48  * Join a vector of strings by some glue string between each pair from the
49  * sequence.
50  *
51  * \param glue string to glue
52  * \param parts the vector of strings to join
53  * \return string constructed from the vector with the glue between two strings
54  */
56  const std::string& glue, const std::vector<std::string>& parts);
57 
58 //! \}
59 
60 } // namespace tlx
61 
62 #endif // !TLX_STRING_JOIN_HEADER
63 
64 /******************************************************************************/
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
Definition: allocator.hpp:220
std::string join(char glue, const std::vector< std::string > &parts)
Join a vector of strings by some glue character between each pair from the sequence.
Definition: join.cpp:16