diff options
Diffstat (limited to 'src/boolean.cpp')
-rw-r--r-- | src/boolean.cpp | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/boolean.cpp b/src/boolean.cpp deleted file mode 100644 index 729e644..0000000 --- a/src/boolean.cpp +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | #include "gats/boolean.h" | ||
2 | |||
3 | #include <bu/formatter.h> | ||
4 | #include <bu/stream.h> | ||
5 | |||
6 | Gats::Boolean::Boolean() : | ||
7 | bVal( false ) | ||
8 | { | ||
9 | } | ||
10 | |||
11 | Gats::Boolean::Boolean( bool bVal ) : | ||
12 | bVal( bVal ) | ||
13 | { | ||
14 | } | ||
15 | |||
16 | Gats::Boolean::~Boolean() | ||
17 | { | ||
18 | } | ||
19 | |||
20 | Gats::Object *Gats::Boolean::clone() const | ||
21 | { | ||
22 | return new Gats::Boolean( bVal ); | ||
23 | } | ||
24 | |||
25 | void Gats::Boolean::write( Bu::Stream &rOut ) const | ||
26 | { | ||
27 | if( bVal ) | ||
28 | { | ||
29 | rOut.write("1", 1 ); | ||
30 | } | ||
31 | else | ||
32 | { | ||
33 | rOut.write("0", 1 ); | ||
34 | } | ||
35 | } | ||
36 | |||
37 | void Gats::Boolean::read( Bu::Stream &rIn, char cType ) | ||
38 | { | ||
39 | if( cType == '1' ) | ||
40 | { | ||
41 | bVal = true; | ||
42 | } | ||
43 | else | ||
44 | { | ||
45 | bVal = false; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Boolean &b ) | ||
50 | { | ||
51 | return f << "(bool) " << b.getValue(); | ||
52 | } | ||
53 | |||