]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/scalar.cc
release: 1.3.37
[lilypond.git] / flower / scalar.cc
index f981bc101f83a5b5f01f4fbc3cb44eb8fea52dfc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,58 +0,0 @@
-#include <stdio.h>
-#include "scalar.hh"
-
-Scalar::Scalar(Rational r)
-    :String(r)
-{
-
-}
-
-Scalar::operator Rational()
-{
-    int p = pos('/');
-    if (!p)
-       return int(*this);
-    
-    String s2 = right(len()-p);
-    p--;
-    String s1 = left(p);
-
-    return Rational(s1.value(), s2.value());
-}
-
-bool
-Scalar::isnum()
-{
-    int conv = false;
-    if (len()) {
-       long l =0;
-       conv = sscanf(data, "%ld", &l);
-    }
-    return len() && conv;
-}
-
-Scalar::operator Real()
-{
-    assert (isnum());
-    return fvalue();
-}
-
-Scalar::operator int()
-{
-    assert (isnum());
-    return value();
-}
-
-bool
-Scalar::to_bool() const
-{
-    if (!len())
-       return false;
-    if (*this == "0")
-       return false;
-    String u (*this);
-    u.upper();
-    if (u== "FALSE")
-       return false;
-    return true;
-}