aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-08-27 21:53:54 +0000
committerMike Buland <eichlan@xagasoft.com>2010-08-27 21:53:54 +0000
commitc10c9ef627c7e79fde6170fe334238bbcb5d66e5 (patch)
tree4a0971d81e666e91866ddeaf9b58b952ce2fdd0a /src/string.cpp
parent2a72923397d866f33221b9d32a3f9653d1a960e7 (diff)
downloadlibgats-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.cpp22
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
5Gats::String::String() 7Gats::String::String()
6{ 8{
7} 9}
8 10
11Gats::String::String( const char *s ) :
12 Bu::FString( s )
13{
14}
15
16Gats::String::String( const char *s, long iLength ) :
17 Bu::FString( s, iLength )
18{
19}
20
21Gats::String::String( long iLength ) :
22 Bu::FString( iLength )
23{
24}
25
9Gats::String::String( const String &s ) : 26Gats::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
56Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::String &s )
57{
58 return f << "(str) \"" << dynamic_cast<const Bu::FString &>(s) << "\"";
59}
60