diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2013-03-02 15:57:34 -0600 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2013-03-02 15:57:34 -0600 |
commit | 7c0b0c9dc9fcbe9c198925bdc7ee18ac6be49f4f (patch) | |
tree | c76702a7f6310fbe9d437e347535422e836e94e9 /tdeabc/plugins/evolution/dbwrapper.h | |
parent | a2a38be7600e2a2c2b49c66902d912ca036a2c0f (diff) | |
parent | 27bbee9a5f9dcda53d8eb23863ee670ad1360e41 (diff) | |
download | tdelibs-7c0b0c9dc9fcbe9c198925bdc7ee18ac6be49f4f.tar.gz tdelibs-7c0b0c9dc9fcbe9c198925bdc7ee18ac6be49f4f.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdelibs
Diffstat (limited to 'tdeabc/plugins/evolution/dbwrapper.h')
-rw-r--r-- | tdeabc/plugins/evolution/dbwrapper.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tdeabc/plugins/evolution/dbwrapper.h b/tdeabc/plugins/evolution/dbwrapper.h new file mode 100644 index 000000000..e5e0a2c33 --- /dev/null +++ b/tdeabc/plugins/evolution/dbwrapper.h @@ -0,0 +1,60 @@ +#ifndef KABC_EVOLUTION_DB_WRAPPER +#define KABC_EVOLUTION_DB_WRAPPER + +#include <db.h> + +#include <tqstring.h> +#include <tqpair.h> + +namespace Evolution { + + class DBWrapper; + class DBIterator { + friend class DBWrapper; + public: + DBIterator( DBWrapper* = 0l ); + ~DBIterator(); + + DBIterator( const DBIterator& ); + DBIterator &operator=( const DBIterator& ); + + TQString key()const; + TQString value()const; + + TQString operator*(); + + DBIterator &operator++(); + DBIterator &operator--(); + + bool operator==( const DBIterator& ); + bool operator!=( const DBIterator& ); + private: + struct Data; + Data* data; + }; + class DBWrapper { + public: + DBWrapper(); + ~DBWrapper(); + + TQString lastError()const; + + bool open( const TQString& file, bool readOnly = false); + bool save(); + DBIterator begin(); + DBIterator end(); + + bool find( const TQString& key, TQString& value ); + bool add( const TQString& key, const TQString& val ); + bool remove( const TQString& key ); + private: + // DBT element( const TQString& ); + struct Data; + Data* data; + + }; + +} + + +#endif |