TaggedFile::Tag Class Reference

#include <TaggedFile.h>

List of all members.

Public Types

typedef std::map
< std::string,
TagRetrievalPos
posmaptype

Public Member Functions

 Tag (const std::string &name, datatype dtype, tagtype ttype=REJECTLOCALE)
void setEndTag (std::string end)
assignstatus assign (const std::string &locale, TaggedParser &parser, std::istream &istr)
void clear ()
const std::string & Name () const
const std::string & Data () const
const TagRetrievalPos Pos (const std::string &locale="") const
const posmaptype PosMap () const
std::streamoff posDataStart (const std::string &locale="") const
std::streamoff posDataEnd (const std::string &locale="") const

Private Attributes

std::string _name
std::string _end
posmaptype _pos
std::string _data
datatype _datatype
tagtype _tagtype

Friends

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


Detailed Description

A Tag has a starttag, probably and endtag as well as data and the start and end positions in the stream

Member Typedef Documentation

typedef std::map<std::string, TagRetrievalPos> TaggedFile::Tag::posmaptype


Constructor & Destructor Documentation

TaggedFile::Tag::Tag ( const std::string &  name,
datatype  dtype,
tagtype  ttype = REJECTLOCALE 
)

Constructor

Parameters:
name Name of Tag
type how to handle multiple assignments of the same tag


Member Function Documentation

void TaggedFile::Tag::setEndTag ( std::string  end  )  [inline]

override old-style end tag (needed e.g. for update.inf parsing which reversed DefaultInstsrcFTP to PTFCrstsniTluafed which can _not_ be handle automagically :-}

assignstatus TaggedFile::Tag::assign ( const std::string &  locale,
TaggedParser parser,
std::istream &  istr 
)

assign data from stream to tag

Parameters:
parser = TaggedParser to use
locale = locale found at tag
istr = stream to use
Returns:
assignstatus
if REJECTED_NOENDTAG is returned, stream and parser are in an undefined state

void TaggedFile::Tag::clear (  )  [inline]

clears only data, not behavior nor tag names

const std::string& TaggedFile::Tag::Name (  )  const [inline]

Name() return name of this tag

const std::string& TaggedFile::Tag::Data (  )  const [inline]

return single line data of current tag

const TagRetrievalPos TaggedFile::Tag::Pos ( const std::string &  locale = ""  )  const

return start position of data in stream

const posmaptype TaggedFile::Tag::PosMap (  )  const [inline]

return complete positionmap

std::streamoff TaggedFile::Tag::posDataStart ( const std::string &  locale = ""  )  const [inline]

return start position of data in stream

std::streamoff TaggedFile::Tag::posDataEnd ( const std::string &  locale = ""  )  const [inline]

return end position of data in stream


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  str,
const TaggedFile::Tag obj 
) [friend]


Member Data Documentation

std::string TaggedFile::Tag::_name [private]

name of the tag

std::string TaggedFile::Tag::_end [private]

name of the end tag for datatype MULTIOLD

posmaptype TaggedFile::Tag::_pos [private]

start and end position of data in stream indexed by locale

std::string TaggedFile::Tag::_data [private]

the actual data for a SINGLE, REJECTLOCALE datatype. for all other datatypes, only _pos is retrieved

datatype TaggedFile::Tag::_datatype [private]

the type of data for this tag

tagtype TaggedFile::Tag::_tagtype [private]

the type of tag


The documentation for this class was generated from the following file:
Generated on Fri Sep 21 22:35:03 2007 for liby2util by  doxygen 1.5.3