#include "gats/string.h" #include "gats/integer.h" #include Gats::String::String() { } Gats::String::String( const char *s ) : Bu::FString( s ) { } Gats::String::String( const char *s, long iLength ) : Bu::FString( s, iLength ) { } Gats::String::String( long iLength ) : Bu::FString( iLength ) { } Gats::String::String( const String &s ) : Bu::FString( s ) { } Gats::String::String( const Bu::FString &s ) : Bu::FString( s ) { } Gats::String::~String() { } void Gats::String::write( Bu::Stream &rOut ) const { rOut.write("s", 1 ); uint32_t iSize = getSize(); Gats::Integer::writePackedInt( rOut, iSize ); rOut.write( getStr(), iSize ); } void Gats::String::read( Bu::Stream &rIn, char cType ) { uint32_t iSize; Gats::Integer::readPackedInt( rIn, iSize ); setSize( iSize ); rIn.read( getStr(), iSize ); } Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::String &s ) { return f << "(str) \"" << dynamic_cast(s) << "\""; }