diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-08-27 21:53:54 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-08-27 21:53:54 +0000 |
commit | c10c9ef627c7e79fde6170fe334238bbcb5d66e5 (patch) | |
tree | 4a0971d81e666e91866ddeaf9b58b952ce2fdd0a /src/string.cpp | |
parent | 2a72923397d866f33221b9d32a3f9653d1a960e7 (diff) | |
download | libgats-c10c9ef627c7e79fde6170fe334238bbcb5d66e5.tar.gz libgats-c10c9ef627c7e79fde6170fe334238bbcb5d66e5.tar.bz2 libgats-c10c9ef627c7e79fde6170fe334238bbcb5d66e5.tar.xz libgats-c10c9ef627c7e79fde6170fe334238bbcb5d66e5.zip |
Added formatter handlers for debugging, works really well. Also added a bunch
more helpers to make it as easy to use as possible.
Diffstat (limited to 'src/string.cpp')
-rw-r--r-- | src/string.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/string.cpp b/src/string.cpp index 416375d..2134a01 100644 --- a/src/string.cpp +++ b/src/string.cpp | |||
@@ -2,10 +2,27 @@ | |||
2 | 2 | ||
3 | #include "gats/integer.h" | 3 | #include "gats/integer.h" |
4 | 4 | ||
5 | #include <bu/formatter.h> | ||
6 | |||
5 | Gats::String::String() | 7 | Gats::String::String() |
6 | { | 8 | { |
7 | } | 9 | } |
8 | 10 | ||
11 | Gats::String::String( const char *s ) : | ||
12 | Bu::FString( s ) | ||
13 | { | ||
14 | } | ||
15 | |||
16 | Gats::String::String( const char *s, long iLength ) : | ||
17 | Bu::FString( s, iLength ) | ||
18 | { | ||
19 | } | ||
20 | |||
21 | Gats::String::String( long iLength ) : | ||
22 | Bu::FString( iLength ) | ||
23 | { | ||
24 | } | ||
25 | |||
9 | Gats::String::String( const String &s ) : | 26 | Gats::String::String( const String &s ) : |
10 | Bu::FString( s ) | 27 | Bu::FString( s ) |
11 | { | 28 | { |
@@ -36,3 +53,8 @@ void Gats::String::read( Bu::Stream &rIn, char cType ) | |||
36 | rIn.read( getStr(), iSize ); | 53 | rIn.read( getStr(), iSize ); |
37 | } | 54 | } |
38 | 55 | ||
56 | Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::String &s ) | ||
57 | { | ||
58 | return f << "(str) \"" << dynamic_cast<const Bu::FString &>(s) << "\""; | ||
59 | } | ||
60 | |||