25 #ifndef ICL_CORE_STRING_HELPER_H_INCLUDED 26 #define ICL_CORE_STRING_HELPER_H_INCLUDED 40 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 49 std::ostringstream out;
57 std::ostringstream out;
58 out << std::boolalpha << x;
64 const int sigdigits = std::numeric_limits<double>::digits10;
65 std::ostringstream out;
66 out << std::setprecision(sigdigits) << x;
72 const int sigdigits = std::numeric_limits<float>::digits10;
73 std::ostringstream out;
74 out << std::setprecision(sigdigits) << x;
80 const int sigdigits = std::numeric_limits<long double>::digits10;
81 std::ostringstream out;
82 out << std::setprecision(sigdigits) << x;
88 std::transform(str.begin(), str.end(), str.begin(), ::tolower);
94 std::transform(str.begin(), str.end(), str.begin(), ::toupper);
108 size_t str_len = str.length();
111 return String(width - str_len, pad_chr) + str;
119 template <
typename T>
128 size_t str_len = str.length();
131 return str +
String(width - str_len, pad_chr);
159 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 165 return stringify<T>(x);
169 template <>
inline String Stringify<bool>(
const bool& x) ICL_CORE_GCC_DEPRECATE_STYLE;
175 template <>
inline String Stringify<double>(
const double& x) ICL_CORE_GCC_DEPRECATE_STYLE;
181 template <>
inline String Stringify<float>(
const float& x) ICL_CORE_GCC_DEPRECATE_STYLE;
187 template <>
inline String Stringify<long double>(
const long double& x) ICL_CORE_GCC_DEPRECATE_STYLE;
206 template <
typename T>
209 template <
typename T>
213 return padLeft<T>(x, width, pad_chr);
217 inline String PadLeft<String>(
const String& str,
size_t width,
char pad_chr)
218 ICL_CORE_GCC_DEPRECATE_STYLE;
221 String PadLeft<String>(
const String& str,
size_t width,
char pad_chr)
226 template <
typename T>
229 template <
typename T>
233 return padRight<T>(x, width, pad_chr);
237 inline String PadRight<String>(
const String& str,
size_t width,
char pad_chr)
238 ICL_CORE_GCC_DEPRECATE_STYLE;
241 String PadRight<String>(
const String& str,
size_t width,
char pad_chr)
Helper definitions for template programming.
String padRight< String >(const String &str, size_t width, char pad_chr)
#define ICL_CORE_VC_DEPRECATE_STYLE
std::vector< String > split(const String &str, const String &delimiter)
String toUpper(icl_core::String str)
String toLower(icl_core::String str)
String padLeft(typename ConvertToRef< T >::ToConstRef x, size_t width, char pad_chr= ' ')
String trim(String const &str)
Contains macros to deprecate classes, types, functions and variables.
String stringify< float >(const float &x)
String join(const std::vector< String > &substrings, const String &delimiter)
#define ICL_CORE_IMPORT_EXPORT
String stringify< bool >(const bool &x)
String stringify(typename ConvertToRef< T >::ToConstRef x)
String stringify< long double >(const long double &x)
String padLeft< String >(const String &str, size_t width, char pad_chr)
Contains import/export definitions for the Win32 plattform.
String padRight(typename ConvertToRef< T >::ToConstRef x, size_t width, char pad_chr= ' ')
String stringify< double >(const double &x)
Contains Interface base classes and base types.
#define ICL_CORE_GCC_DEPRECATE_STYLE