Hydra 0.20
|
#include <Records.h>
Public Types | |
typedef std::set< QString > | parent_t |
typedef std::set< QString > | set_t |
Public Member Functions | |
void | debugPrint (void) const |
debugPrint function | |
bool | insertTag (const QString &newtag, bool *imageChanged=0) |
bool | eraseTag (const QString &newtag, bool *imageChanged=0) |
bool | clearTags (bool *imageChanged=0) |
bool | containsKey (const QString &key) const |
bool | insertKey (const QString &key, const QString &value, bool *imageChanged=0) |
bool | eraseKey (const QString &key, bool *imageChanged=0) |
QString | keyValue (const QString &key) const |
Static Public Member Functions | |
static int | indexOfKeyValue (const QString &s) |
Static Public Attributes | |
static const char | SEP_CHAR = '=' |
A set or tags (strings).
A std::set derived class that provides additional useful functions for dealing with tag sets.
bool hydra::Tags::clearTags | ( | bool * | imageChanged = 0 | ) |
Erases all the tags. See insertTag for API info.
bool hydra::Tags::containsKey | ( | const QString & | key | ) | const |
Check if this tag set has the given key. Key-values look like: key=value Note that if there is no =, then it is not a valid key-value. Therefore basic tags will return false for this test.
TODO in the future, switch the hole Tags concept to a std::map, which would be optimized for empty-values (as 99% of the tags wont have any values)... or not
bool hydra::Tags::eraseKey | ( | const QString & | key, |
bool * | imageChanged = 0 |
||
) |
Erase the given key, no matter what's its value. Returns true if anything was erased, false otherwise.
bool hydra::Tags::eraseTag | ( | const QString & | newtag, |
bool * | imageChanged = 0 |
||
) |
Erases a tag. See insertTag for API info.
static int hydra::Tags::indexOfKeyValue | ( | const QString & | s | ) | [inline, static] |
Returns the index of the keyvalue seperator, or -1 for not found.
bool hydra::Tags::insertKey | ( | const QString & | key, |
const QString & | value, | ||
bool * | imageChanged = 0 |
||
) |
Sets the current value for the given key. Returns true if anything was done.
bool hydra::Tags::insertTag | ( | const QString & | newtag, |
bool * | imageChanged = 0 |
||
) |
Sets the given tag, while maintaining some consistancy (for example, = key values). This is prefered over direct write access to the std::set class. In the future, direct access may be eliminated (or the whole thing replaced with a map?)
If imageChanged is non-null AND this operation changes the image (rotate tags), then *imageChanged will be set to true. It will be untouched otherwise.
tag | the tag to insert/set. |
imageChanged | was the image "changed" |
QString hydra::Tags::keyValue | ( | const QString & | key | ) | const |
Return the given value for the given key. Returns "" if this key doesnt exist. Key-values look like: key=value Note that if there is no =, then it is not a valid key-value. Therefore basic tags will return false for this test.
TODO in the future, switch the hole Tags concept to a std::map, which would be optimized for empty-values (as 99% of the tags wont have any values)... or not