#include <idmapper.h>
Public Member Functions | |
IdMapper () | |
IdMapper (const TQString &path, const TQString &identifier=TQString()) | |
~IdMapper () | |
void | setPath (const TQString &path) |
TQString | path () const |
void | setIdentifier (const TQString &identifier) |
TQString | identifier () const |
bool | load () |
bool | save () |
void | clear () |
void | setRemoteId (const TQString &localId, const TQString &remoteId) |
void | removeRemoteId (const TQString &remoteId) |
TQString | remoteId (const TQString &localId) const |
TQString | localId (const TQString &remoteId) const |
void | setFingerprint (const TQString &localId, const TQString &fingerprint) |
const TQString & | fingerprint (const TQString &localId) const |
TQMap< TQString, TQString > | remoteIdMap () const |
TQString | asString () const |
Protected Member Functions | |
TQString | 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() [1/2]
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() [2/2]
IdMapper::IdMapper | ( | const TQString & | path, |
const TQString & | identifier = TQString() |
||
) |
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::~IdMapper | ( | ) |
Destructor.
Definition at line 41 of file idmapper.cpp.
Member Function Documentation
◆ asString()
TQString IdMapper::asString | ( | ) | const |
Returns a string representation of the id pairs, that's usefull for debugging.
Definition at line 155 of file idmapper.cpp.
◆ clear()
void IdMapper::clear | ( | ) |
Clears the map.
Definition at line 112 of file idmapper.cpp.
◆ filename()
|
protected |
Returns the filename this mapper is (or will be) stored in.
Definition at line 55 of file idmapper.cpp.
◆ fingerprint()
const TQString & IdMapper::fingerprint | ( | const TQString & | 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.
◆ identifier()
|
inline |
Return id map identifier.
Definition at line 75 of file idmapper.h.
◆ load()
bool IdMapper::load | ( | ) |
Loads the map.
Definition at line 64 of file idmapper.cpp.
◆ localId()
TQString IdMapper::localId | ( | const TQString & | remoteId | ) | const |
Returns the local id for the given remote id.
Definition at line 145 of file idmapper.cpp.
◆ path()
|
inline |
Return id map path.
Definition at line 66 of file idmapper.h.
◆ remoteId()
TQString IdMapper::remoteId | ( | const TQString & | localId | ) | const |
Returns the remote id of the given local id.
Definition at line 134 of file idmapper.cpp.
◆ remoteIdMap()
TQMap< TQString, TQString > 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.
◆ removeRemoteId()
void IdMapper::removeRemoteId | ( | const TQString & | remoteId | ) |
Removes the remote id.
Definition at line 123 of file idmapper.cpp.
◆ save()
bool IdMapper::save | ( | ) |
Saves the map.
Definition at line 88 of file idmapper.cpp.
◆ setFingerprint()
void IdMapper::setFingerprint | ( | const TQString & | localId, |
const TQString & | 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.
◆ setIdentifier()
void IdMapper::setIdentifier | ( | const TQString & | identifier | ) |
Set id map identifier.
Definition at line 50 of file idmapper.cpp.
◆ setPath()
void IdMapper::setPath | ( | const TQString & | path | ) |
Set id map path.
Definition at line 45 of file idmapper.cpp.
◆ setRemoteId()
void IdMapper::setRemoteId | ( | const TQString & | localId, |
const TQString & | remoteId | ||
) |
Stores the remote id for the given local id.
Definition at line 118 of file idmapper.cpp.
The documentation for this class was generated from the following files: