Reader Class Reference

Reader reads a number of lines from an input stream until it finds and empty line.Reader::AttributeSet is used for passing the keys Reader should look out for. Any other keys will be ignored. More...

#include <read.h>


Public Types

typedef std::map< std::string,
bool > 
AttributeSet

Public Member Functions

int parse (const AttributeSet &, std::istream &)
void reset ()
bool haveAllRequired (const AttributeSet &) const
const std::string & getInput () const
const std::string & getValue (const std::string &key) const
const std::string & getValue (const std::string &key, const std::string def) const
const std::string getParsedString () const


Detailed Description

Reader reads a number of lines from an input stream until it finds and empty line.Reader::AttributeSet is used for passing the keys Reader should look out for. Any other keys will be ignored.

Author:
Michael Moritz

Definition at line 41 of file read.h.


Member Typedef Documentation

typedef std::map<std::string,bool> Reader::AttributeSet

AttributeSet holds a list of keywords to look out for and a bool specififying if it it is a required keywords

Definition at line 51 of file read.h.


Member Function Documentation

int Reader::parse ( const AttributeSet ,
std::istream &   
)

Returns:
the number of attributes from AttributeSet parsed or -1 if EOF

void Reader::reset (  )  [inline]

reset the stored data

Definition at line 59 of file read.h.

bool Reader::haveAllRequired ( const AttributeSet  )  const

check if all required attributes have been read

Definition at line 57 of file read.cpp.

const std::string& Reader::getInput (  )  const [inline]

Returns:
a string that contains the complete input, including anything that has been ignored, seperated by " " if in verbose mode

Definition at line 69 of file read.h.

const std::string& Reader::getValue ( const std::string &  key  )  const [inline]

Parameters:
key the key to look for
Returns:
a string if the key has been found, otherwise the not-found-string which can be checked for with isNotFound

Definition at line 77 of file read.h.

const std::string& Reader::getValue ( const std::string &  key,
const std::string  def 
) const [inline]

Parameters:
key the key to look for
def default value to return if key has not been found
Returns:
a string if the key has been found, otherwise the string def

Definition at line 90 of file read.h.


The documentation for this class was generated from the following files:
Generated on Tue Jul 24 16:36:54 2007 for gps by  doxygen 1.5.1