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