DLTagList Class Reference

Metadata tag container object. More...

#include <DLTagList.h>

List of all members.

Public Types

typedef std::map< string,
string >::iterator 
iterator
typedef std::map< string,
string >::const_iterator 
const_iterator

Public Member Functions

 DLTagList ()
virtual DLTagListoperator= (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


Detailed Description

Metadata tag container object.

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.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

DLTagList::DLTagList (  ) 

Default DLTagList Constructor

virtual DLTagList::~DLTagList (  )  [virtual]

Default DLTagList Destructor


Member Function Documentation

virtual DLTagList& DLTagList::operator= ( const DLTagList right  )  [inline, virtual]

Assignment operator

Parameters:
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

Parameters:
tagKey key of the specified tag
Returns:
the field value of the 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.

Parameters:
tagKey key of the document tag
tagValue value of the document tag
overwriteEnabled option for overwriting existing field (default is false)
Exceptions:
DL_Exception DL_UNKNOWN_TAG_EXCEPTION

void DLTagList::dlDeleteTag ( string  tagKey  ) 

Remove the tag with the specified key from the list of tags

Parameters:
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

Parameters:
tagKey key of the document tag
Returns:
true if a tag exists with that key

bool DLTagList::dlIsTagListEmpty (  )  const [inline]

Check whether the whole tag list is empty

Returns:
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

Returns:
iterator

Definition at line 134 of file DLTagList.h.

References tagMap.

Referenced by DLImage::dlFindTag().


Member Data Documentation

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=().


The documentation for this class was generated from the following file:

DOCLIB is being developed under contract by a collaboration between:
The Laboratory for Language and Media Processing
Unviersity of Maryland, College Park
and
Booz | Allen | Hamilton

All Rights Reserved, 2003-2007