#include <DLTagList.h>
Public Types | |
typedef std::map< string, string >::iterator | iterator |
typedef std::map< string, string >::const_iterator | const_iterator |
Public Member Functions | |
DLTagList () | |
virtual DLTagList & | operator= (const DLTagList &right) |
string | dlGetTag (string tagKey) const |
void | dlSetTag (string tagKey, string tagValue, bool overwriteEnabled=false) |
void | dlDeleteTag (string tagKey) |
void | dlClearTags () |
bool | dlIsTagSet (string tagKey) const |
bool | dlIsTagListEmpty () const |
virtual | ~DLTagList () |
iterator | begin () |
Obtain an iterator to the beginning of the DLTagList. | |
iterator | end () |
const_iterator | begin () const |
Obtain a const_iterator to the beginning of the DLTagList. | |
const_iterator | end () const |
iterator | dlFindTag (string tagKey) |
Public Attributes | |
map< string, string > | tagMap |
The DLTagList object is a container which can store tags made up of string key-value pairs. This can be used for storing metadata about images and document components, and is used in DLImageHead::imageTags, DLDocument::documentTags, DLPage::pageTags, and DLZone::zoneTags.
Definition at line 19 of file DLTagList.h.
typedef std::map<string, string>::iterator DLTagList::iterator |
Iterator which iterates over all the elements of a DLTagList. The first and second operators of an iterator may be used to access the tags and keys, respectively, pointed to by the iterator, e.g.:
for (DLTagList::iterator ii = t->begin(); ii != t->end(); ii++) cout << ii->first << " " << ii->second << endl;
Definition at line 97 of file DLTagList.h.
typedef std::map<string, string>::const_iterator DLTagList::const_iterator |
Const Iterator which iterates over all the elements of a DLTagList. The first and second operators of an iterator may be used to access the tags and keys, respectively, pointed to by the iterator, e.g.:
for (DLTagList::const_iterator ii = t->begin(); ii != t->end(); ii++) cout << ii->first << " " << ii->second << endl;
Definition at line 119 of file DLTagList.h.
DLTagList::DLTagList | ( | ) |
Default DLTagList Constructor
virtual DLTagList::~DLTagList | ( | ) | [virtual] |
Default DLTagList Destructor
Assignment operator
right | Tag list to be copied |
Definition at line 33 of file DLTagList.h.
References tagMap.
string DLTagList::dlGetTag | ( | string | tagKey | ) | const |
Get the field value of a specified tag
tagKey | key of the specified tag |
void DLTagList::dlSetTag | ( | string | tagKey, | |
string | tagValue, | |||
bool | overwriteEnabled = false | |||
) |
Set a tag. If a tag with the specified key already exists in this document, it will not be overwritten unless the optional parameter overwriteEnabled is set to true
.
tagKey | key of the document tag | |
tagValue | value of the document tag | |
overwriteEnabled | option for overwriting existing field (default is false ) |
DL_Exception | DL_UNKNOWN_TAG_EXCEPTION |
void DLTagList::dlDeleteTag | ( | string | tagKey | ) |
Remove the tag with the specified key from the list of tags
tagKey | key of the tag to remove |
void DLTagList::dlClearTags | ( | ) | [inline] |
Erase all the existing tags
Definition at line 66 of file DLTagList.h.
References tagMap.
Referenced by DLImage::dlClearTags().
bool DLTagList::dlIsTagSet | ( | string | tagKey | ) | const |
Check whether a document tag with the given key exists
tagKey | key of the document tag |
bool DLTagList::dlIsTagListEmpty | ( | ) | const [inline] |
Check whether the whole tag list is empty
true
if the tag list is empty. Definition at line 79 of file DLTagList.h.
References tagMap.
Referenced by DLImage::dlIsTagListEmpty().
iterator DLTagList::begin | ( | ) | [inline] |
Obtain an iterator to the beginning of the DLTagList.
Definition at line 100 of file DLTagList.h.
References tagMap.
Referenced by DLImage::dlGetTagListBegin().
iterator DLTagList::end | ( | ) | [inline] |
Obtain an iterator pointing just past the end of the DLTagList. The end() iterator is typically used in a for
loop for bounds checking. Warning: dereferencing the end() iterator is undefined, and will likely cause your program to crash.
Definition at line 106 of file DLTagList.h.
References tagMap.
Referenced by DLImage::dlGetTagListEnd().
const_iterator DLTagList::begin | ( | ) | const [inline] |
Obtain a const_iterator to the beginning of the DLTagList.
Definition at line 122 of file DLTagList.h.
References tagMap.
const_iterator DLTagList::end | ( | ) | const [inline] |
Obtain a const_iterator pointing just past the end of the DLTagList. The end() const_iterator is typically used in a for
loop for bounds checking. Warning: dereferencing the end() iterator is undefined, and will likely cause your program to crash.
Definition at line 128 of file DLTagList.h.
References tagMap.
iterator DLTagList::dlFindTag | ( | string | tagKey | ) | [inline] |
Get an iterator pointing to the location of tagKey
in the map
Definition at line 134 of file DLTagList.h.
References tagMap.
Referenced by DLImage::dlFindTag().
map<string, string> DLTagList::tagMap |
Definition at line 22 of file DLTagList.h.
Referenced by begin(), DLZone::dlClearTags(), dlClearTags(), DLPage::dlClearTags(), DLDocument::dlClearTags(), DLZone::dlFindTag(), dlFindTag(), DLPage::dlFindTag(), DLDocument::dlFindTag(), DLZone::dlIsTagListEmpty(), dlIsTagListEmpty(), DLPage::dlIsTagListEmpty(), DLDocument::dlIsTagListEmpty(), end(), and operator=().