diff options
Diffstat (limited to 'c++-libbu++/src/integer.cpp')
-rw-r--r-- | c++-libbu++/src/integer.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
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 @@ | |||
1 | #include "gats/integer.h" | ||
2 | |||
3 | #include <bu/formatter.h> | ||
4 | |||
5 | Gats::Integer::Integer() : | ||
6 | iVal( 0 ) | ||
7 | { | ||
8 | } | ||
9 | |||
10 | Gats::Integer::Integer( int64_t iVal ) : | ||
11 | iVal( iVal ) | ||
12 | { | ||
13 | } | ||
14 | |||
15 | Gats::Integer::~Integer() | ||
16 | { | ||
17 | } | ||
18 | |||
19 | Gats::Object *Gats::Integer::clone() const | ||
20 | { | ||
21 | return new Gats::Integer( iVal ); | ||
22 | } | ||
23 | |||
24 | void Gats::Integer::write( Bu::Stream &rOut ) const | ||
25 | { | ||
26 | rOut.write("i", 1 ); | ||
27 | writePackedInt( rOut, iVal ); | ||
28 | } | ||
29 | |||
30 | void Gats::Integer::read( Bu::Stream &rIn, char cType ) | ||
31 | { | ||
32 | readPackedInt( rIn, iVal ); | ||
33 | } | ||
34 | |||
35 | Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Integer &i ) | ||
36 | { | ||
37 | return f << "(int) " << i.getValue(); | ||
38 | } | ||
39 | |||