aboutsummaryrefslogtreecommitdiff
path: root/c++-qt/src/string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++-qt/src/string.cpp')
-rw-r--r--c++-qt/src/string.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/c++-qt/src/string.cpp b/c++-qt/src/string.cpp
index 1eddcf6..fd6cad1 100644
--- a/c++-qt/src/string.cpp
+++ b/c++-qt/src/string.cpp
@@ -57,13 +57,37 @@ void Gats::String::write( QIODevice &rOut ) const
57 rOut.write( constData(), iSize ); 57 rOut.write( constData(), iSize );
58} 58}
59 59
60void Gats::String::read( QIODevice &rIn, char cType ) 60void Gats::String::read( QIODevice &rIn, char /*cType*/ )
61{ 61{
62 uint32_t iSize; 62 uint32_t iSize;
63 Gats::Integer::readPackedInt( rIn, iSize ); 63 Gats::Integer::readPackedInt( rIn, iSize );
64 fill( '\0', iSize ); 64 fill( '\0', iSize );
65 rIn.read( data(), iSize ); 65 rIn.read( data(), iSize );
66} 66}
67
68QString Gats::String::toString( int /*iIndent*/ ) const
69{
70 QString sRet("\"");
71 for( const_iterator iS = begin(); iS != end(); iS++ )
72 {
73 switch( *iS )
74 {
75 case '\\':
76 sRet += "\\";
77 break;
78
79 case '\"':
80 sRet += "\\\"";
81 break;
82
83 default:
84 sRet += *iS;
85 break;
86 }
87 }
88 sRet += "\"";
89 return sRet;
90}
67/* 91/*
68Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::String &s ) 92Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::String &s )
69{ 93{