|
Babel
1
The voip software that only works on your local network
|
Functions | |
| const std::string | myToString (bool value) |
| Converts a boolean value to its string representation. | |
| template<typename T > | |
| const std::string | myToString (const T &value) |
| Converts a numeric value to its string representation. | |
| template<typename T1 , typename T2 > | |
| const std::string | myToString (const std::pair< T1, T2 > &value) |
Converts a std::pair to its string representation. | |
| template<typename Key , typename Value > | |
| std::string | myToString (const std::map< Key, Value > &map) |
| Converts a std::map to a string representation. | |
| template<typename T > | |
| std::string | myToString (const std::set< T > &set) |
| Converts a std::set to a string representation. | |
| template<typename T > | |
| const std::string | myToString (const std::vector< T > &set) |
| Converts a std::vector to a string representation. | |
| template<typename Key , typename Value > | |
| std::string | myToString (const std::unordered_map< Key, Value > &map) |
| Converts a std::unordered_map to a string representation. | |
| template<typename T > | |
| const std::string | myToString (const std::unordered_set< T > &set) |
| Converts a std::unordered_set to a string representation. | |
| const std::string Recoded::myToString | ( | bool | value | ) |
Converts a boolean value to its string representation.
Unlike std::to_string, which converts true to "1" and false to "0", this function returns "true" for true and "false" for false.
| value | The boolean value to convert. |
Recoded::myToString to convert elements to strings.| value | The boolean value to convert. |
Definition at line 22 of file ToString.cpp.
| std::string Recoded::myToString | ( | const std::map< Key, Value > & | map | ) |
Converts a std::map to a string representation.
This function iterates over the key-value pairs of a std::map and generates a string in the format: ‘{ 'key1’ : 'value1', 'key2' : 'value2', ... }`.
| Key | The type of the keys in the map. |
| Value | The type of the values in the map. |
| map | The map to be converted to a string. |
Recoded::myToString to convert keys and values to strings. Definition at line 109 of file ToString.hpp.
| const std::string Recoded::myToString | ( | const std::pair< T1, T2 > & | value | ) |
Converts a std::pair to its string representation.
This function formats the std::pair as ( x: <first>, y: <second> ), where <first> and <second> are the string representations of the pair's elements. The elements' string representations are generated using myToString.
Example:
| T1 | The type of the first element in the pair. |
| T2 | The type of the second element in the pair. |
| value | The pair to convert. |
( x: <first>, y: <second> ).Recoded::myToString to convert elements to strings. Definition at line 87 of file ToString.hpp.
| std::string Recoded::myToString | ( | const std::set< T > & | set | ) |
Converts a std::set to a string representation.
This function iterates over the elements of a std::set and generates a string in the format: ‘{ 'element1’, 'element2', ... }`.
| T | The type of the elements in the set. |
| set | The set to be converted to a string. |
Recoded::myToString to convert elements to strings. Definition at line 137 of file ToString.hpp.
| std::string Recoded::myToString | ( | const std::unordered_map< Key, Value > & | map | ) |
Converts a std::unordered_map to a string representation.
This function iterates over the key-value pairs of a std::unordered_map and generates a string in the format: ‘{ 'key1’ : 'value1', 'key2' : 'value2', ... }`.
| Key | The type of the keys in the unordered map. |
| Value | The type of the values in the unordered map. |
| map | The unordered map to be converted to a string. |
Recoded::myToString to convert keys and values to strings. Definition at line 193 of file ToString.hpp.
| const std::string Recoded::myToString | ( | const std::unordered_set< T > & | set | ) |
Converts a std::unordered_set to a string representation.
This function iterates over the elements of a std::unordered_set and generates a string in the format: ‘{ 'element1’, 'element2', ... }`.
| T | The type of the elements in the unordered set. |
| set | The unordered set to be converted to a string. |
Recoded::myToString to convert elements to strings. Definition at line 221 of file ToString.hpp.
| const std::string Recoded::myToString | ( | const std::vector< T > & | set | ) |
Converts a std::vector to a string representation.
This function iterates over the elements of a std::vector and generates a string in the format: ‘[ 'element1’, 'element2', ... ]`.
| T | The type of the elements in the vector. |
| vec | The vector to be converted to a string. |
Recoded::myToString to convert elements to strings. Definition at line 164 of file ToString.hpp.
| const std::string Recoded::myToString | ( | const T & | value | ) |
Converts a numeric value to its string representation.
This function is a wrapper around std::to_string and supports all types for which std::to_string is valid. It is intended for general use with numeric types like int, float, double, etc.
| T | The type of the value to convert. Must be a numeric type. |
| value | The value to convert. |
Recoded::myToString to convert elements to strings. Definition at line 59 of file ToString.hpp.