]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/scalar.cc
patch::: 1.3.119.jcn3
[lilypond.git] / flower / scalar.cc
index 5edd9e997f3ba2128cc2760282419c198074e5c6..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,57 +0,0 @@
-#include <assert.h>
-#include <stdio.h>
-#include "scalar.hh"
-
-Scalar::Scalar(Rational r)
-    :String(r)
-{
-
-}
-
-Scalar::operator Rational()
-{
-    int p = index_i('/');
-    if (p == -1)
-       return int(*this);
-    
-    String s2 = right_str(len()-p-1);
-    String s1 = left_str(p);
-
-    return Rational(s1.value_i(), s2.value_i());
-}
-
-bool
-Scalar::isnum()
-{
-    int conv = false;
-    if (len()) {
-       long l =0;
-       conv = sscanf(strh_.ch_c_l(), "%ld", &l);
-    }
-    return len() && conv;
-}
-
-Scalar::operator Real()
-{
-    assert (isnum());
-    return value_f();
-}
-
-Scalar::operator int()
-{
-    assert (isnum());
-    return value_i();
-}
-
-
-Scalar::operator bool() const
-{
-    if (!len())
-       return false;
-    if (*this == "0")
-       return false;
-    String u (*this);
-    if ( u.upper_str() == "FALSE")
-       return false;
-    return true;
-}