KDE PIM / Developers / API Docs / kitchensync

KSync::SyncHistoryMap Class Reference

A small helper class to map a string (timestamp,md5sum) from and to a uid and save this map on permanent storage like KConfig. More...

#include <synchistory.h>

List of all members.

Public Types

Public Member Functions

Protected Member Functions


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.


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

KSync::SyncHistoryMap::~SyncHistoryMap  )  [virtual]
 

Destructor, cleans up and deletes the internal Config object.


Member Function Documentation

QString KSync::SyncHistoryMap::fileName  )  const
 

Returns:
the FileName that was supplied on instantiation

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.

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

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.

bool KSync::SyncHistoryMap::contains const QString &  id_key  )  const
 

Returns:
True if the
Parameters:
id_key is inside the internal map

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

void KSync::SyncHistoryMap::set const SyncHistoryMap::Map &  map  ) 
 

replace the internal map with the parameter

Parameters:
map Replace the internal map with this one

SyncHistoryMap::Map KSync::SyncHistoryMap::map  )  const
 

Returns:
Returns the internal used map

void KSync::SyncHistoryMap::clear  ) 
 

Clears the permanent storage and also the internal map.

KConfig * KSync::SyncHistoryMap::config  )  [protected]
 

creates the kconfig object on demand


The documentation for this class was generated from the following files: