From 115cb44594b8e14baf64412e85ee92cd4a002293 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 8 Mar 1997 19:29:07 +0000 Subject: [PATCH] lilypond-0.0.40 --- flower/lib/include/string-convert.hh | 6 +- flower/test/stringtest.cc | 130 +++++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 flower/test/stringtest.cc diff --git a/flower/lib/include/string-convert.hh b/flower/lib/include/string-convert.hh index bcf461f8f3..f6bcfa7fae 100644 --- a/flower/lib/include/string-convert.hh +++ b/flower/lib/include/string-convert.hh @@ -30,14 +30,16 @@ public: 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 hex2int_i( String str ); + 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(const void *); - static String longlong_str(long long , char const * fmt = 0); + static String i64_str(I64, char const * fmt = 0); }; #endif // __STRING_CONVERT_HH // diff --git a/flower/test/stringtest.cc b/flower/test/stringtest.cc new file mode 100644 index 0000000000..5b4ace1b2f --- /dev/null +++ b/flower/test/stringtest.cc @@ -0,0 +1,130 @@ +#ifdef STRING_TEST +/* + stupid test program to verify stringlib + stringtest.cc + */ +#include +#include "string.hh" +#include "varray.hh" +#include "string-convert.hh" + +void +ctors() +{ + cout << "constructors"< a; + a.push("abcd"); + a.push("zxy"); + a.push("abc"); + a.push(""); + a.sort(String::compare_i); + cout << "compares: "<