diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-08-14 07:12:29 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-08-14 07:12:29 +0000 |
commit | 1b797548dff7e2475826ba29a71c3f496008988f (patch) | |
tree | 2a81ee2e8fa2f17fd95410aabbf44533d35a727a /src/boolean.cpp | |
download | libgats-1b797548dff7e2475826ba29a71c3f496008988f.tar.gz libgats-1b797548dff7e2475826ba29a71c3f496008988f.tar.bz2 libgats-1b797548dff7e2475826ba29a71c3f496008988f.tar.xz libgats-1b797548dff7e2475826ba29a71c3f496008988f.zip |
libgats gets it's own repo. The rest of the history is in my misc repo.
Diffstat (limited to '')
-rw-r--r-- | src/boolean.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/boolean.cpp b/src/boolean.cpp new file mode 100644 index 0000000..087845a --- /dev/null +++ b/src/boolean.cpp | |||
@@ -0,0 +1,42 @@ | |||
1 | #include "gats/boolean.h" | ||
2 | |||
3 | #include <bu/stream.h> | ||
4 | |||
5 | Gats::Boolean::Boolean() : | ||
6 | bVal( false ) | ||
7 | { | ||
8 | } | ||
9 | |||
10 | Gats::Boolean::Boolean( bool bVal ) : | ||
11 | bVal( bVal ) | ||
12 | { | ||
13 | } | ||
14 | |||
15 | Gats::Boolean::~Boolean() | ||
16 | { | ||
17 | } | ||
18 | |||
19 | void Gats::Boolean::write( Bu::Stream &rOut ) const | ||
20 | { | ||
21 | if( bVal ) | ||
22 | { | ||
23 | rOut.write("1", 1 ); | ||
24 | } | ||
25 | else | ||
26 | { | ||
27 | rOut.write("0", 1 ); | ||
28 | } | ||
29 | } | ||
30 | |||
31 | void Gats::Boolean::read( Bu::Stream &rIn, char cType ) | ||
32 | { | ||
33 | if( cType == '1' ) | ||
34 | { | ||
35 | bVal = true; | ||
36 | } | ||
37 | else | ||
38 | { | ||
39 | bVal = false; | ||
40 | } | ||
41 | } | ||
42 | |||