diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 17:20:11 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 17:20:11 +0000 |
| commit | d534a56d95bca7bdd812be024d9eacba4734e2b7 (patch) | |
| tree | f9b98ee2b80e645a7b54e7934882be6c9f73c165 /c++-libbu++/src/integer.cpp | |
| parent | 61ccc86fdf06f12cb72a8b7e65286f812cf62154 (diff) | |
| download | libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.gz libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.bz2 libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.tar.xz libgats-d534a56d95bca7bdd812be024d9eacba4734e2b7.zip | |
Many changes: tabconv'd the C++ code, added a license, BSD, and docs.
Diffstat (limited to 'c++-libbu++/src/integer.cpp')
| -rw-r--r-- | c++-libbu++/src/integer.cpp | 21 |
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 | ||
| 5 | Gats::Integer::Integer() : | 12 | Gats::Integer::Integer() : |
| 6 | iVal( 0 ) | 13 | iVal( 0 ) |
| 7 | { | 14 | { |
| 8 | } | 15 | } |
| 9 | 16 | ||
| 10 | Gats::Integer::Integer( int64_t iVal ) : | 17 | Gats::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 | ||
| 19 | Gats::Object *Gats::Integer::clone() const | 26 | Gats::Object *Gats::Integer::clone() const |
| 20 | { | 27 | { |
| 21 | return new Gats::Integer( iVal ); | 28 | return new Gats::Integer( iVal ); |
| 22 | } | 29 | } |
| 23 | 30 | ||
| 24 | void Gats::Integer::write( Bu::Stream &rOut ) const | 31 | void 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 | ||
| 30 | void Gats::Integer::read( Bu::Stream &rIn, char cType ) | 37 | void Gats::Integer::read( Bu::Stream &rIn, char cType ) |
| 31 | { | 38 | { |
| 32 | readPackedInt( rIn, iVal ); | 39 | readPackedInt( rIn, iVal ); |
| 33 | } | 40 | } |
| 34 | 41 | ||
| 35 | Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Integer &i ) | 42 | Bu::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 | ||
