libemailfunctions
KPIM::IdMapper Class Reference
An Id Mapper maps Ids. More...
#include <idmapper.h>
Public Member Functions | |
QString | asString () const |
void | clear () |
const QString & | fingerprint (const QString &localId) const |
QString | identifier () const |
IdMapper (const QString &path, const QString &identifier=QString::null) | |
IdMapper () | |
bool | load () |
QString | localId (const QString &remoteId) const |
QString | path () const |
QString | remoteId (const QString &localId) const |
QMap< QString, QString > | remoteIdMap () const |
void | removeRemoteId (const QString &remoteId) |
bool | save () |
void | setFingerprint (const QString &localId, const QString &fingerprint) |
void | setIdentifier (const QString &identifier) |
void | setPath (const QString &path) |
void | setRemoteId (const QString &localId, const QString &remoteId) |
~IdMapper () | |
Protected Member Functions | |
QString | filename () |
Detailed Description
An Id Mapper maps Ids.What to or what for is not entirely clear, but maps have categories. This is probably an adjoint functor, since adjoint functors are everywhere.
Definition at line 37 of file idmapper.h.
Constructor & Destructor Documentation
IdMapper::IdMapper | ( | ) |
Create Id mapper.
You have to set path and identifier before you can call load() or save().
Definition at line 32 of file idmapper.cpp.
Create Id mapper.
The path specifies the category of mapping, the identifier the concrete object.
If you don't pass an identifier you have to set it before calling load() or save().
The current implementation stores the data at /share/apps/<path>/<identifier>.
Definition at line 36 of file idmapper.cpp.
IdMapper::~IdMapper | ( | ) |
Member Function Documentation
QString IdMapper::asString | ( | ) | const |
Returns a string representation of the id pairs, that's usefull for debugging.
Definition at line 155 of file idmapper.cpp.
void IdMapper::clear | ( | ) |
QString IdMapper::filename | ( | ) | [protected] |
Returns the filename this mapper is (or will be) stored in.
Definition at line 55 of file idmapper.cpp.
Returns the fingerprint for the map.
- Todo:
- Figure out if this applies to the last set fingerprint or if anything else can change it.
Definition at line 175 of file idmapper.cpp.
QString KPIM::IdMapper::identifier | ( | ) | const [inline] |
bool IdMapper::load | ( | ) |
QString KPIM::IdMapper::path | ( | ) | const [inline] |
Returns the entire map for the Id mapper.
- Todo:
- Document what the map means.
Definition at line 183 of file idmapper.cpp.
void IdMapper::removeRemoteId | ( | const QString & | remoteId | ) |
bool IdMapper::save | ( | ) |
Stores a fingerprint for an id which can be used to detect if the locally held version differs from what is on the server.
This can be a sequence number of an md5 hash depending on what the server provides
Definition at line 170 of file idmapper.cpp.
void IdMapper::setIdentifier | ( | const QString & | identifier | ) |
void IdMapper::setPath | ( | const QString & | path | ) |
The documentation for this class was generated from the following files: