diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | c90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch) | |
tree | 6d8391395bce9eaea4ad78958617edb20c6a7573 /lskat/lskatproc/KEMessage.h | |
download | tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lskat/lskatproc/KEMessage.h')
-rw-r--r-- | lskat/lskatproc/KEMessage.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/lskat/lskatproc/KEMessage.h b/lskat/lskatproc/KEMessage.h new file mode 100644 index 00000000..0a1913cc --- /dev/null +++ b/lskat/lskatproc/KEMessage.h @@ -0,0 +1,66 @@ +/*************************************************************************** + KEMessage.h - description + ------------------- + begin : Tue May 2 2000 + copyright : (C) 2000 by Martin Heni + email : martin@heni-online.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#ifndef _KEMESSAGE_H_ +#define _KEMESSAGE_H_ + +#include <string.h> +#include <qstring.h> +#include <qstrlist.h> +#include <qdict.h> +#include "KMessageEntry.h" + +#define KEMESSAGE_HEAD QString(QCString("BEGIN_V1000")) +#define KEMESSAGE_TAIL QString(QCString("END_V1000")) +#define KEMESSAGE_CR QString(QCString("\n")) +#define KEMESSAGE_SEP QString(QCString(":::")) + +class KEMessage +{ + private: + QStrList keys; + QDict<KMessageEntry> dict; + + protected: + void AddEntry(QString key,KMessageEntry *entry); + public: + QStrList *QueryKeys(); + uint QueryNumberOfKeys(); + void AddDataType(QString key,int size,const char *data,KGM_TYPE type); + void AddData(QString key,short data); + void AddData(QString key,long data); + void AddData(QString key,float data); + void AddData(QString key,const char *data,int size=-1); + bool GetData(QString key,short &s); + bool GetData(QString key,long &l); + bool GetData(QString key,float &f); + bool GetData(QString key,char * &c,int &size); + bool HasKey(QString key); + void Remove(QString key); + KGM_TYPE QueryType(QString key); + QString ToString(); + QString EntryToString(char *key,KMessageEntry *entry); + QString StringToEntry(QString str,KMessageEntry *entry); + bool AddString(QString s); + bool AddStringMsg(QString str); + void RemoveAll(); + ~KEMessage(); + KEMessage(); + KEMessage(KEMessage &msg); + KEMessage &operator=(KEMessage &msg); +}; + +#endif |