Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

TaggedFile::TagSet Class Reference

#include <TaggedFile.h>

List of all members.

Public Member Functions

 TagSet ()
virtual ~TagSet ()
void setAllowMultipleSets (bool flag)
void setAllowUnknownTags (bool flag)
void addTag (const std::string &name, int idx, datatype dtype, tagtype ttype=REJECTLOCALE)
assignstatus assignSet (TaggedParser &parser, std::istream &istr)
TaggetTagByIndex (unsigned int idx)

Private Types

typedef std::map< std::string,
Tag * > 
tagmaptype
typedef std::vector< Tag * > tagvectortype

Private Member Functions

void setTagByIndex (int idx, Tag *t)
assignstatus assign (const std::string &starttag, const std::string &startlocale, TaggedParser &parser, std::istream &istr)

Private Attributes

bool _allow_multiple_sets
bool _allow_unknown_tags
tagmaptype _tags
tagvectortype _tagv
bool _reuse_previous_tag

Friends

std::ostream & operator<< (std::ostream &str, const TaggedFile::TagSet &obj)


Detailed Description

TagSet manages all Tags contained in a file. It redirects assignments to the proper Tag


Member Typedef Documentation

typedef std::map<std::string, Tag *> TaggedFile::TagSet::tagmaptype [private]
 

language dependant tags, needed for setting the encoding

typedef std::vector<Tag*> TaggedFile::TagSet::tagvectortype [private]
 

index <-> string mapping for access-by-index since this is faster and easier when handling the complete tagset


Constructor & Destructor Documentation

TaggedFile::TagSet::TagSet  ) 
 

TaggedFile::TagSet::~TagSet  )  [virtual]
 


Member Function Documentation

void TaggedFile::TagSet::addTag const std::string &  name,
int  idx,
datatype  dtype,
tagtype  ttype = REJECTLOCALE
[inline]
 

add Tag to TagSet

Parameters:
name name of tag
idx index for getTagByIndex, -1 for n/a
dtype datatype for tag
ttype tagtype for tag

assignstatus TaggedFile::TagSet::assign const std::string &  starttag,
const std::string &  startlocale,
TaggedParser parser,
std::istream &  istr
[private]
 

lookup single Tag responsible for parsing starttag in map and call its assign function

Parameters:
starttag Tag to assign
istr stream to parse

assignstatus TaggedFile::TagSet::assignSet TaggedParser parser,
std::istream &  istr
 

assign complete TagSet from parser and stream

Parameters:
parser parser to use
istr stream to parse

Tag* TaggedFile::TagSet::getTagByIndex unsigned int  idx  )  [inline]
 

get Tag by number instead of string

Parameters:
idx Tag number
Returns:
pointer to tag or NULL if idx doesn't exist

void TaggedFile::TagSet::setAllowMultipleSets bool  flag  )  [inline]
 

allow multiple sets

void TaggedFile::TagSet::setAllowUnknownTags bool  flag  )  [inline]
 

allow unknown tags

void TaggedFile::TagSet::setTagByIndex int  idx,
Tag t
[inline, private]
 

assign number to Tag

Parameters:
idx number
t Tag*


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  str,
const TaggedFile::TagSet obj
[friend]
 


Member Data Documentation

bool TaggedFile::TagSet::_allow_multiple_sets [private]
 

file contains multiple sets or single set

bool TaggedFile::TagSet::_allow_unknown_tags [private]
 

allow unknown tags

bool TaggedFile::TagSet::_reuse_previous_tag [private]
 

re-use previous tag (used in assignSet() to re-use last parser state from previous ACCEPTED_FULL)

tagmaptype TaggedFile::TagSet::_tags [private]
 

map of tags managed by this tagset

tagvectortype TaggedFile::TagSet::_tagv [private]
 


The documentation for this class was generated from the following files:
Generated on Thu Feb 23 23:56:11 2006 for liby2util by doxygen 1.3.6