#include "gats-qt/string.h" #include "gats-qt/integer.h" Gats::String::String() { } Gats::String::String( const char *s ) : QByteArray( s ) { } Gats::String::String( const char *s, long iLength ) : QByteArray( s, iLength ) { } Gats::String::String( long iLength ) : QByteArray( iLength, '\0' ) { } Gats::String::String( const String &s ) : QByteArray( s ) { } Gats::String::String( const QByteArray &s ) : QByteArray( s ) { } Gats::String::~String() { } Gats::Object *Gats::String::clone() const { QByteArray baClone = *this; baClone.detach(); return new Gats::String( baClone ); } void Gats::String::write( QIODevice &rOut ) const { rOut.write("s", 1 ); uint32_t iSize = size(); Gats::Integer::writePackedInt( rOut, iSize ); rOut.write( constData(), iSize ); } void Gats::String::read( QIODevice &rIn, char cType ) { uint32_t iSize; Gats::Integer::readPackedInt( rIn, iSize ); fill( '\0', iSize ); rIn.read( data(), iSize ); } /* Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::String &s ) { return f << "(str) \"" << dynamic_cast(s) << "\""; } */