kitchensync
KSync::SyncHistoryMap Class Reference
#include <synchistory.h>
Detailed Description
A small helper class to map a string (timestamp,md5sum) from and to a uid and save this map on permanent storage like KConfig.
Definition at line 40 of file synchistory.h.
Public Types | |
typedef QMap< QString, QString > | Map |
typedef QMap< QString, QString >::Iterator | Iterator |
Public Member Functions | |
SyncHistoryMap (const QString &fileName=QString::null) | |
virtual | ~SyncHistoryMap () |
void | setFileName (const QString &fileName) |
QString | fileName () const |
void | load () |
void | save () |
QString | text (const QString &id_key) const |
bool | contains (const QString &id_key) const |
void | insert (const QString &id_key, const QString &text_data) |
void | set (const SyncHistoryMap::Map &) |
SyncHistoryMap::Map | map () const |
void | clear () |
Protected Member Functions | |
KConfig * | config () |
Constructor & Destructor Documentation
KSync::SyncHistoryMap::SyncHistoryMap | ( | const QString & | file = QString::null |
) |
Construct an empty MetaMap.
You need to call load to retrive the information from the permanent storage.
SyncHistoryMap *map = new SyncHistoryMap(metaData); map->load();
- Parameters:
-
file The file where the information is stored
Definition at line 40 of file synchistory.cpp.
KSync::SyncHistoryMap::~SyncHistoryMap | ( | ) | [virtual] |
Destructor, cleans up and deletes the internal Config object.
Definition at line 49 of file synchistory.cpp.
Member Function Documentation
QString KSync::SyncHistoryMap::fileName | ( | ) | const |
- Returns:
- the FileName that was supplied on instantiation
Definition at line 58 of file synchistory.cpp.
void KSync::SyncHistoryMap::load | ( | ) |
load the information
This method possible creates a KConfig object if mFile is a valid path and tries to load the saved MetaData and fills the internal map.
Definition at line 70 of file synchistory.cpp.
void KSync::SyncHistoryMap::save | ( | ) |
Saves the current Map to a permanent storage and wipes out any previous data.
Calling without a prior call to load() works as well as the Config object is created on demand
Definition at line 91 of file synchistory.cpp.
QString KSync::SyncHistoryMap::text | ( | const QString & | id_key | ) | const |
- Parameters:
-
id_key The ID to retrieve the text for
- Returns:
- Returns the to the id_key associated text or an empty string in case of the id_key is not contained.
Definition at line 114 of file synchistory.cpp.
bool KSync::SyncHistoryMap::contains | ( | const QString & | id_key | ) | const |
- Returns:
- True if the
- Parameters:
-
id_key is inside the internal map
Definition at line 122 of file synchistory.cpp.
void KSync::SyncHistoryMap::insert | ( | const QString & | id_key, | |
const QString & | text_data | |||
) |
If the id_key already existed before the old incarnation is shadowed.
- Parameters:
-
id_key the Key for the inernal map text_data The text associated with the id_key
Definition at line 134 of file synchistory.cpp.
void KSync::SyncHistoryMap::set | ( | const SyncHistoryMap::Map & | map | ) |
replace the internal map with the parameter
- Parameters:
-
map Replace the internal map with this one
Definition at line 144 of file synchistory.cpp.
SyncHistoryMap::Map KSync::SyncHistoryMap::map | ( | ) | const |
void KSync::SyncHistoryMap::clear | ( | ) |
Clears the permanent storage and also the internal map.
Definition at line 162 of file synchistory.cpp.
KConfig * KSync::SyncHistoryMap::config | ( | ) | [protected] |
The documentation for this class was generated from the following files: