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