From 74dd68ad611d15abf16a65c36a7cfd3f4492930a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 9 Nov 2012 16:25:22 +0000 Subject: Made the repo less libbu++-centric. --- c++-libbu++/src/integer.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 c++-libbu++/src/integer.cpp (limited to 'c++-libbu++/src/integer.cpp') diff --git a/c++-libbu++/src/integer.cpp b/c++-libbu++/src/integer.cpp new file mode 100644 index 0000000..e89ac1d --- /dev/null +++ b/c++-libbu++/src/integer.cpp @@ -0,0 +1,39 @@ +#include "gats/integer.h" + +#include + +Gats::Integer::Integer() : + iVal( 0 ) +{ +} + +Gats::Integer::Integer( int64_t iVal ) : + iVal( iVal ) +{ +} + +Gats::Integer::~Integer() +{ +} + +Gats::Object *Gats::Integer::clone() const +{ + return new Gats::Integer( iVal ); +} + +void Gats::Integer::write( Bu::Stream &rOut ) const +{ + rOut.write("i", 1 ); + writePackedInt( rOut, iVal ); +} + +void Gats::Integer::read( Bu::Stream &rIn, char cType ) +{ + readPackedInt( rIn, iVal ); +} + +Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Integer &i ) +{ + return f << "(int) " << i.getValue(); +} + -- cgit v1.2.3