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