From 1b797548dff7e2475826ba29a71c3f496008988f Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 14 Aug 2010 07:12:29 +0000 Subject: libgats gets it's own repo. The rest of the history is in my misc repo. --- src/boolean.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/boolean.cpp (limited to 'src/boolean.cpp') 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 @@ +#include "gats/boolean.h" + +#include + +Gats::Boolean::Boolean() : + bVal( false ) +{ +} + +Gats::Boolean::Boolean( bool bVal ) : + bVal( bVal ) +{ +} + +Gats::Boolean::~Boolean() +{ +} + +void Gats::Boolean::write( Bu::Stream &rOut ) const +{ + if( bVal ) + { + rOut.write("1", 1 ); + } + else + { + rOut.write("0", 1 ); + } +} + +void Gats::Boolean::read( Bu::Stream &rIn, char cType ) +{ + if( cType == '1' ) + { + bVal = true; + } + else + { + bVal = false; + } +} + -- cgit v1.2.3