aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-08-14 07:12:29 +0000
committerMike Buland <eichlan@xagasoft.com>2010-08-14 07:12:29 +0000
commit1b797548dff7e2475826ba29a71c3f496008988f (patch)
tree2a81ee2e8fa2f17fd95410aabbf44533d35a727a /src/string.cpp
downloadlibgats-1b797548dff7e2475826ba29a71c3f496008988f.tar.gz
libgats-1b797548dff7e2475826ba29a71c3f496008988f.tar.bz2
libgats-1b797548dff7e2475826ba29a71c3f496008988f.tar.xz
libgats-1b797548dff7e2475826ba29a71c3f496008988f.zip
libgats gets it's own repo. The rest of the history is in my misc repo.
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/string.cpp b/src/string.cpp
new file mode 100644
index 0000000..416375d
--- /dev/null
+++ b/src/string.cpp
@@ -0,0 +1,38 @@
1#include "gats/string.h"
2
3#include "gats/integer.h"
4
5Gats::String::String()
6{
7}
8
9Gats::String::String( const String &s ) :
10 Bu::FString( s )
11{
12}
13
14Gats::String::String( const Bu::FString &s ) :
15 Bu::FString( s )
16{
17}
18
19Gats::String::~String()
20{
21}
22
23void Gats::String::write( Bu::Stream &rOut ) const
24{
25 rOut.write("s", 1 );
26 uint32_t iSize = getSize();
27 Gats::Integer::writePackedInt( rOut, iSize );
28 rOut.write( getStr(), iSize );
29}
30
31void Gats::String::read( Bu::Stream &rIn, char cType )
32{
33 uint32_t iSize;
34 Gats::Integer::readPackedInt( rIn, iSize );
35 setSize( iSize );
36 rIn.read( getStr(), iSize );
37}
38