From 82da0238a8171cf8bba6bb1c82d5abba207a10aa Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 31 Mar 2012 17:34:11 +0000 Subject: Gats for QT is here. It's a pretty basic conversion right now, it doesn't support debugging formatting (Bu::sio), it doesn't support gats-text string parsing, and the exceptions need to be fixed to be real exceptions. The basic functions have been renamed to match the Qt API and we use QT types for everything (QHash, QList, QByteArray). It needs more testing, but it's a great start. --- c++-qt/src/list.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 c++-qt/src/list.h (limited to 'c++-qt/src/list.h') diff --git a/c++-qt/src/list.h b/c++-qt/src/list.h new file mode 100644 index 0000000..f712fa5 --- /dev/null +++ b/c++-qt/src/list.h @@ -0,0 +1,57 @@ +#ifndef GATS_LIST_H +#define GATS_LIST_H + +#include "gats-qt/object.h" +#include + +namespace Gats +{ + class Dictionary; + + class List : public Gats::Object, public QList + { + Q_OBJECT; + public: + List(); + virtual ~List(); + + virtual Type getType() const { return typeList; } + + virtual void write( QIODevice &rOut ) const; + virtual void read( QIODevice &rIn, char cType ); + + void append( const char *s ); + void append( const QByteArray &s ); + void append( int32_t i ); + void append( int64_t i ); + void append( double d ); + using QList::append; + void appendStr( const QByteArray &s ); + void appendInt( int64_t i ); + void appendFloat( double d ); + void appendBool( bool b ); + void appendList( Gats::List *pL ); + void appendDict( Gats::Dictionary *pD ); + Gats::List *appendList(); + Gats::Dictionary *appendDict(); + + void prepend( const char *s ); + void prepend( const QByteArray &s ); + void prepend( int32_t i ); + void prepend( int64_t i ); + void prepend( double d ); + using QList::prepend; + void prependStr( const QByteArray &s ); + void prependInt( int64_t i ); + void prependFloat( double d ); + void prependBool( bool b ); + void prependList( Gats::List *pL ); + void prependDict( Gats::Dictionary *pD ); + Gats::List *prependList(); + Gats::Dictionary *prependDict(); + }; +}; + +//Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::List &l ); + +#endif -- cgit v1.2.3