libemailfunctions
KPIM::IdMapper Class Reference
#include <idmapper.h>
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.
Public Member Functions | |
IdMapper () | |
IdMapper (const QString &path, const QString &identifier=QString::null) | |
~IdMapper () | |
void | setPath (const QString &path) |
QString | path () const |
void | setIdentifier (const QString &identifier) |
QString | identifier () const |
bool | load () |
bool | save () |
void | clear () |
void | setRemoteId (const QString &localId, const QString &remoteId) |
void | removeRemoteId (const QString &remoteId) |
QString | remoteId (const QString &localId) const |
QString | localId (const QString &remoteId) const |
void | setFingerprint (const QString &localId, const QString &fingerprint) |
const QString & | fingerprint (const QString &localId) const |
QMap< QString, QString > | remoteIdMap () const |
QString | asString () const |
Protected Member Functions | |
QString | filename () |
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.
IdMapper::IdMapper | ( | const QString & | path, | |
const QString & | identifier = QString::null | |||
) |
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
void IdMapper::setPath | ( | const QString & | path | ) |
QString KPIM::IdMapper::path | ( | ) | const [inline] |
void IdMapper::setIdentifier | ( | const QString & | identifier | ) |
QString KPIM::IdMapper::identifier | ( | ) | const [inline] |
bool IdMapper::load | ( | ) |
bool IdMapper::save | ( | ) |
void IdMapper::clear | ( | ) |
void IdMapper::setRemoteId | ( | const QString & | localId, | |
const QString & | remoteId | |||
) |
void IdMapper::removeRemoteId | ( | const QString & | remoteId | ) |
QString IdMapper::remoteId | ( | const QString & | localId | ) | const |
QString IdMapper::localId | ( | const QString & | remoteId | ) | const |
void IdMapper::setFingerprint | ( | const QString & | localId, | |
const QString & | fingerprint | |||
) |
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.
const QString & IdMapper::fingerprint | ( | const QString & | localId | ) | const |
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.
QMap< QString, QString > IdMapper::remoteIdMap | ( | ) | const |
Returns the entire map for the Id mapper.
- Todo:
- Document what the map means.
Definition at line 183 of file idmapper.cpp.
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.
QString IdMapper::filename | ( | ) | [protected] |
Returns the filename this mapper is (or will be) stored in.
Definition at line 55 of file idmapper.cpp.
The documentation for this class was generated from the following files: