/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/external/stlplus/include/stlplus/string_utilities.hpp Source File
|
Ratpac-two
|
string_utilities.hpp
35 // This is a minimum - if the value requires more digits then it will be wider than the width argument
38 // For example, using the hash representation of 0 in hex with width=4 gives: 16#0000 - so there's 4 digits in the
41 std::string to_string(bool i, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
44 std::string to_string(short i, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
47 std::string to_string(unsigned short i, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
50 std::string to_string(int i, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
53 std::string to_string(unsigned int i, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
56 std::string to_string(long i, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
59 std::string to_string(unsigned long i, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
62 std::string to_string(const void*, unsigned radix = 16, radix_display_t display = radix_c_style_or_hash,
97 // A non-zero radix should be used when the string value has no radix information and is non-decimal
127 // Note: STLplus containers tend to have built-in string conversion functions consistent with these
130 std::string pointer_to_string(const T* value, const std::string& null_string, const std::string& prefix,
147 std::string multimap_to_string(const std::multimap<K, T, P>& values, const std::string& pair_separator,
154 std::string multiset_to_string(const std::multiset<K, P>& values, const std::string& separator);
167 // set the number of spaces to indent per indent step (i.e. the number of spaces = indent*indent_step)
177 otext& print(otext& str, const bool& value, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
180 otext& print(otext& str, const short& value, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
186 otext& print(otext& str, const int& value, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
192 otext& print(otext& str, const long& value, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
198 otext& print(otext& str, const void*& value, unsigned radix = 10, radix_display_t display = radix_c_style_or_hash,
221 otext& print_pointer(otext& str, const T* value, const std::string& null_string, const std::string& prefix,
224 otext& print_pointer(otext& str, const T* value, unsigned indent, const std::string& null_string,
240 otext& print_pair(otext& str, const std::pair<L, R>& values, const std::string& separator, unsigned indent);
243 otext& print_map(otext& str, const std::map<K, T, P>& values, const std::string& pair_separator,
246 otext& print_map(otext& str, const std::map<K, T, P>& values, const std::string& pair_separator, unsigned indent);
249 otext& print_multimap(otext& str, const std::multimap<K, T, P>& values, const std::string& pair_separator,
252 otext& print_multimap(otext& str, const std::multimap<K, T, P>& values, const std::string& pair_separator,
261 otext& print_multiset(otext& str, const std::multiset<K, P>& values, const std::string& separator);
279 std::string pad(const std::string& str, alignment_t alignment, unsigned width, char padch = ' ') throw();
293 // converts the filename to uppercase and returns the result (Note that the uppercase function does this more easily).
294 // if the from_set is longer than the to_set, then the overlap represents characters to delete (i.e. they map to
296 std::string translate(const std::string& input, const std::string& from_set, const std::string& to_set);
302 // this function does wildcard matching of the wildcard expression against the candidate std::string
304 // the wildcard characters are * and ? where * matches 1 or more characters and ? matches only one
315 // splits the string at every occurance of splitter and adds it as a separate string to the return value
325 std::string join(const std::vector<std::string>&, const std::string& joiner = "\n", const std::string& prefix = "",
334 // display the parameter in seconds as a string representation in weeks, days, hours, minutes, seconds
Definition: textio.hpp:37
Generated by