X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Fstring-convert.hh;h=8e1695bd5ceb9d6154fe3d3a5edc5f22e5595a6f;hb=ef31f0442c7be02c90b9e6b2b9e9809def42ae37;hp=6e109e604a2147173fd48ae7338e495aa4b16670;hpb=a6ee9dcd388111e842064a8d46ab06c4897a00d2;p=lilypond.git diff --git a/flower/include/string-convert.hh b/flower/include/string-convert.hh index 6e109e604a..8e1695bd5c 100644 --- a/flower/include/string-convert.hh +++ b/flower/include/string-convert.hh @@ -1,50 +1,52 @@ /* PROJECT: FlowerSoft C++ library FILE : string-convert.hh - */ #ifndef STRING_CONVERT_HH #define STRING_CONVERT_HH -#include -#include "flower-proto.hh" -#include "string.hh" +#include +using namespace std; +#include "flower-proto.hh" +#include "std-string.hh" -/** The functor String_convert handles all conversions to/from String - (some time, anyway). The class is quite empty from data view. */ -class String_convert { - static int hex2bin (String hex_string, String& bin_string_r); +/** The functor string_convert handles all conversions to/from string + (some time, anyway). The class is quite empty from data view. */ +class String_convert +{ + static int hex2bin (string hex_string, string &bin_string_r); static int hex2nibble (Byte byte); static Byte nibble2hex_byte (Byte byte); public: - static String pad_to (String s, int length); - static String bool_string (bool b); - static String bin2dec (String bin_string); - static String bin2hex (String bin_string); - static String dec2bin (String str); - static int bin2int (String bin_string); - static unsigned bin2unsigned (String bin_string); - static String char_string (char c, int n); - static int dec2int (String dec_string); - static double dec2double (String dec_string); - static String double_string (double f, char const* fmt=0); - static String form_string (char const* format, ...); - static String vform_string (char const* format, va_list args); - static int hex2int (String str); - static unsigned hex2unsigned (String str); - static String hex2bin (String str); - static String int_string (int i, char const *fmt=0 ); - static String long_string (long); - static String int2hex (int i, int length_i, char ch); - static String unsigned2hex (unsigned u, int length_i, char ch); - static String int2dec (int i, int length_i, char ch); - static String rational_string (Rational); - static String pointer_string (void const *); - static String precision_string (double x, int n); - static Array split (String str, char c); - static String i64_string (I64, char const * fmt = 0); + static string pad_to (const string &s, size_t length); + static string bool_string (bool b); + static string bin2hex (Byte bin_char); + static string bin2hex (const string &bin_string); + static int bin2int (const string &bin_string); + static unsigned bin2unsigned (const string &bin_string); + static string char_string (char c, int n); + static int dec2int (const string &dec_string); + static double dec2double (const string &dec_string); + static string double_string (double f, char const *fmt = 0); + static string form_string (char const *format, ...) __attribute__ ((format (printf, 1, 2))); + static string vform_string (char const *format, va_list args); + static string hex2bin (const string &str); + static string int_string (int i, char const *fmt = 0); + static string unsigned_string (unsigned); + static string unsigned_long_string (unsigned long); + static string long_string (long); + static string int2hex (int i, size_t length_i, char ch); + static string unsigned2hex (unsigned u, size_t length, char ch); + static string int2dec (int i, size_t length_i, char ch); + static string rational_string (Rational); + static string pointer_string (void const *); + static string precision_string (double x, int n); + static string i64_string (I64, char const *fmt = 0); + static string to_lower (string s); + static string to_upper (string s); + static string reverse (string s); }; #endif // __STRING_CONVERT_HH //