]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/scalar.hh
release: 0.1.59
[lilypond.git] / flower / include / scalar.hh
1 /*
2   scalar.hh -- declare Scalar
3
4   source file of the Flower Library
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef SCALAR_HH
11 #define SCALAR_HH
12
13 #include "string.hh"
14 #include "real.hh"
15
16 /// Perl -like scalar type.
17 struct Scalar : public String {
18     
19   Scalar (Real r) : String (r) {}
20   Scalar (int i) : String (i) {}
21   Scalar (char c) : String (c) {}
22   Scalar (char const *c) : String (c) {}    
23   Scalar (String s):String (s) {}
24   Scalar (Rational);
25   operator Rational();
26   Scalar() {}
27   bool isnum_b() const;
28   operator Real();
29   operator int();
30   bool to_bool () const;
31
32   /**   perl -like string to bool conversion.
33    */
34   operator bool() const;
35 };
36
37 #endif // SCALAR_HH
38