mymoneykeyvaluecontainer.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           mymoneykeyvaluecontainer.h
00003                              -------------------
00004     begin                : Sun Nov 10 2002
00005     copyright            : (C) 2000-2005 by Thomas Baumgart
00006     email                : Thomas Baumgart <ipwizard@users.sourceforge.net>
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef MYMONEYKEYVALUECONTAINER_H
00019 #define MYMONEYKEYVALUECONTAINER_H
00020 
00021 
00026 #ifdef HAVE_CONFIG_H
00027 #include <config.h>
00028 #endif
00029 
00030 // ----------------------------------------------------------------------------
00031 // QT Includes
00032 
00033 #include <qstring.h>
00034 #include <qmap.h>
00035 #include <qdom.h>
00036 #include <kmymoney/export.h>
00037 
00038 // ----------------------------------------------------------------------------
00039 // Project Includes
00040 
00041 
00052 class KMYMONEY_EXPORT MyMoneyKeyValueContainer
00053 {
00054 public:
00055   MyMoneyKeyValueContainer();
00056   MyMoneyKeyValueContainer(const QDomElement& node);
00057 
00058   ~MyMoneyKeyValueContainer();
00059 
00068   const QString& value(const QString& key) const;
00069 
00077   void setValue(const QString& key, const QString& value);
00078 
00085   void deletePair(const QString& key);
00086 
00090   void clear(void);
00091 
00100   const QMap<QString, QString>& pairs(void) const { return m_kvp; };
00101 
00112   void setPairs(const QMap<QString, QString>& list);
00113 
00117   bool operator == (const MyMoneyKeyValueContainer &) const;
00118 
00119   const QString& operator[] ( const QString& k ) const { return value(k); }
00120 
00121   QString& operator[] ( const QString& k) { return m_kvp[k]; }
00122 
00130   void writeXML(QDomDocument& document, QDomElement& parent) const;
00131 
00132 private:
00136   QMap<QString, QString>  m_kvp;
00137 };
00138 
00139 #endif

Generated on Wed Jan 26 13:03:18 2011 for KMyMoney by  doxygen 1.5.6