aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-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