From: fred Date: Wed, 9 Oct 1996 11:08:33 +0000 (+0000) Subject: flower-1.0.1 X-Git-Tag: release/1.5.59~7137 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=232d22ae4614c627f37ff6423c1437208f01718c;p=lilypond.git flower-1.0.1 --- diff --git a/flower/string.cc b/flower/string.cc index cc0e0e6bd8..da4941da7b 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -108,7 +108,8 @@ String::String( const int i, const int n, const char c ) // String convd to const char * } -String::operator const char *() const + const char* +String::ptr() const { return data; } @@ -141,6 +142,7 @@ String::operator >( const Sortable& test ) const return strcmp( data, s->data ) > 0; } #endif + // signed comparison, analogous to strcmp; int String::compare( const char* test ) const @@ -378,3 +380,16 @@ String::reversed() const strrev(s); return retval; } +bool +String::to_bool() const +{ + if (!len()) + return false; + if (*this == "0") + return false; + String u (*this); + u.upper(); + if (u== "FALSE") + return false; + return true; +}