diff options
Diffstat (limited to '')
-rw-r--r-- | c++-qt/src/boolean.cpp | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/c++-qt/src/boolean.cpp b/c++-qt/src/boolean.cpp index 3973607..1195bae 100644 --- a/c++-qt/src/boolean.cpp +++ b/c++-qt/src/boolean.cpp | |||
@@ -1,14 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2012 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libgats library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "gats-qt/boolean.h" | 8 | #include "gats-qt/boolean.h" |
2 | 9 | ||
3 | #include <QIODevice> | 10 | #include <QIODevice> |
4 | 11 | ||
5 | Gats::Boolean::Boolean() : | 12 | Gats::Boolean::Boolean() : |
6 | bVal( false ) | 13 | bVal( false ) |
7 | { | 14 | { |
8 | } | 15 | } |
9 | 16 | ||
10 | Gats::Boolean::Boolean( bool bVal ) : | 17 | Gats::Boolean::Boolean( bool bVal ) : |
11 | bVal( bVal ) | 18 | bVal( bVal ) |
12 | { | 19 | { |
13 | } | 20 | } |
14 | 21 | ||
@@ -18,35 +25,35 @@ Gats::Boolean::~Boolean() | |||
18 | 25 | ||
19 | Gats::Object *Gats::Boolean::clone() const | 26 | Gats::Object *Gats::Boolean::clone() const |
20 | { | 27 | { |
21 | return new Gats::Boolean( bVal ); | 28 | return new Gats::Boolean( bVal ); |
22 | } | 29 | } |
23 | 30 | ||
24 | void Gats::Boolean::write( QIODevice &rOut ) const | 31 | void Gats::Boolean::write( QIODevice &rOut ) const |
25 | { | 32 | { |
26 | if( bVal ) | 33 | if( bVal ) |
27 | { | 34 | { |
28 | rOut.write("1", 1 ); | 35 | rOut.write("1", 1 ); |
29 | } | 36 | } |
30 | else | 37 | else |
31 | { | 38 | { |
32 | rOut.write("0", 1 ); | 39 | rOut.write("0", 1 ); |
33 | } | 40 | } |
34 | } | 41 | } |
35 | 42 | ||
36 | void Gats::Boolean::read( QIODevice &rIn, char cType ) | 43 | void Gats::Boolean::read( QIODevice &rIn, char cType ) |
37 | { | 44 | { |
38 | if( cType == '1' ) | 45 | if( cType == '1' ) |
39 | { | 46 | { |
40 | bVal = true; | 47 | bVal = true; |
41 | } | 48 | } |
42 | else | 49 | else |
43 | { | 50 | { |
44 | bVal = false; | 51 | bVal = false; |
45 | } | 52 | } |
46 | } | 53 | } |
47 | /* | 54 | /* |
48 | Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Boolean &b ) | 55 | Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Boolean &b ) |
49 | { | 56 | { |
50 | return f << "(bool) " << b.getValue(); | 57 | return f << "(bool) " << b.getValue(); |
51 | } | 58 | } |
52 | */ | 59 | */ |