aboutsummaryrefslogtreecommitdiff
path: root/c++-qt/src/list.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++-qt/src/list.cpp')
-rw-r--r--c++-qt/src/list.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/c++-qt/src/list.cpp b/c++-qt/src/list.cpp
index fae51d1..cca7c46 100644
--- a/c++-qt/src/list.cpp
+++ b/c++-qt/src/list.cpp
@@ -48,7 +48,7 @@ void Gats::List::write( QIODevice &rOut ) const
48 rOut.write("e", 1 ); 48 rOut.write("e", 1 );
49} 49}
50 50
51void Gats::List::read( QIODevice &rIn, char cType ) 51void Gats::List::read( QIODevice &rIn, char /*cType*/ )
52{ 52{
53 for(;;) 53 for(;;)
54 { 54 {
@@ -59,6 +59,32 @@ void Gats::List::read( QIODevice &rIn, char cType )
59 } 59 }
60} 60}
61 61
62QString Gats::List::toString( int iIndent ) const
63{
64 if( count() == 0 )
65 return "[ ]";
66 QString sRet("[");
67 iIndent++;
68 for( const_iterator i = begin(); i != end(); i++ )
69 {
70 if( i != begin() )
71 {
72 sRet += ",\n";
73 }
74 else
75 {
76 sRet += "\n";
77 }
78 for( int j = 0; j < iIndent; j++ ) sRet += " ";
79 sRet += (*i)->toString( iIndent );
80 }
81 sRet += "\n";
82 iIndent--;
83 for( int j = 0; j < iIndent; j++ ) sRet += " ";
84 sRet += ']';
85 return sRet;
86}
87
62void Gats::List::append( const char *s ) 88void Gats::List::append( const char *s )
63{ 89{
64 QList<Gats::Object *>::append( new Gats::String( s ) ); 90 QList<Gats::Object *>::append( new Gats::String( s ) );