From d534a56d95bca7bdd812be024d9eacba4734e2b7 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 9 Nov 2012 17:20:11 +0000 Subject: Many changes: tabconv'd the C++ code, added a license, BSD, and docs. --- c++-qt/src/string.cpp | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'c++-qt/src/string.cpp') diff --git a/c++-qt/src/string.cpp b/c++-qt/src/string.cpp index ef23829..7d2d20f 100644 --- a/c++-qt/src/string.cpp +++ b/c++-qt/src/string.cpp @@ -1,3 +1,10 @@ +/* + * Copyright (C) 2007-2012 Xagasoft, All rights reserved. + * + * This file is part of the libgats library and is released under the + * terms of the license contained in the file LICENSE. + */ + #include "gats-qt/string.h" #include "gats-qt/integer.h" @@ -7,27 +14,27 @@ Gats::String::String() } Gats::String::String( const char *s ) : - QByteArray( s ) + QByteArray( s ) { } Gats::String::String( const char *s, long iLength ) : - QByteArray( s, iLength ) + QByteArray( s, iLength ) { } Gats::String::String( long iLength ) : - QByteArray( iLength, '\0' ) + QByteArray( iLength, '\0' ) { } Gats::String::String( const String &s ) : - QByteArray( s ) + QByteArray( s ) { } Gats::String::String( const QByteArray &s ) : - QByteArray( s ) + QByteArray( s ) { } @@ -37,29 +44,29 @@ Gats::String::~String() Gats::Object *Gats::String::clone() const { - QByteArray baClone = *this; - baClone.detach(); - return new Gats::String( baClone ); + 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 ); + 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 ); + 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) << "\""; + return f << "(str) \"" << dynamic_cast(s) << "\""; } */ -- cgit v1.2.3