]> git.donarmstrong.com Git - lilypond.git/commitdiff
flower-1.0.1
authorfred <fred>
Wed, 9 Oct 1996 11:08:33 +0000 (11:08 +0000)
committerfred <fred>
Wed, 9 Oct 1996 11:08:33 +0000 (11:08 +0000)
flower/string.cc

index cc0e0e6bd84236ba0eb6194ec2a2adaf0ebb1bd3..da4941da7b0dd5993e870707da41e1861e9dafde 100644 (file)
@@ -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;
+}