X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Fstring-convert.hh;h=21ec7f189e2dcd7789623ae1f31df4b8af29c7d3;hb=fd3857da3d3f6a8ec80184d48a6ca0bd48d23091;hp=4842eac2d7add955f6844c9f923eba1755f8c396;hpb=95de6911a5cd1f90dfcd72ec798f089f6522f50f;p=lilypond.git diff --git a/flower/include/string-convert.hh b/flower/include/string-convert.hh index 4842eac2d7..21ec7f189e 100644 --- a/flower/include/string-convert.hh +++ b/flower/include/string-convert.hh @@ -1,44 +1,55 @@ /* PROJECT: FlowerSoft C++ library FILE : string-convert.hh - */ #ifndef STRING_CONVERT_HH #define STRING_CONVERT_HH -#include "fproto.hh" -#include "string.hh" +#include +using namespace std; +#include "flower-proto.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_i (String hex_str, String& bin_str_r); - static int hex2nibble_i (Byte byte); - static Byte nibble2hex_byte (Byte byte); +/** 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 bin2dec_str (String bin_str); - static String bin2hex_str (String bin_str); - static String dec2bin_str (String str); - static int bin2_i (String bin_str); - static unsigned bin2_u (String bin_str); - static String char_str (char c, int n); - static int dec2_i (String dec_str); - static double dec2_f (String dec_str); - static String double_str (double f, char const* fmt=0); - static int hex2_i (String str); - static unsigned hex2_u (String str); - static String hex2bin_str (String str); - static String int_str (int i, char const *fmt=0 ); - static String i2hex_str (int i, int length_i, char ch); - static String u2hex_str (unsigned u, int length_i, char ch); - static String i2dec_str (int i, int length_i, char ch); - static String rational_str (Rational); - static String pointer_str (void const *); - static String precision_str (double x, int n); - static Array split_arr (String str, char c); - static String i64_str (I64, char const * fmt = 0); + static string pad_to (string s, int length); + static string bool_string (bool b); + static string bin2dec (string bin_string); + static string bin2hex (Byte bin_char); + 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, ...) __attribute__ ((format (printf, 1,2))); + 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 unsigned_string (unsigned); + static string long_string (long); + static string int2hex (int i, int length_i, char ch); + static string unsigned2hex (unsigned u, ssize length, 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 vector split (string str, char c); + 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 //