xml::xsilParser Class Reference
[Input parsing classes.]

#include <Xsil.hh>

List of all members.

Public Types

typedef std::map< std::string,
std::string > 
attrlist
 Attribute list.
typedef std::vector
< xsilHandlerQuery * > 
handlerquerylist
 Handler list.
typedef std::vector
< xsilHandlerTemp
worklist
 work list of handlers

Public Member Functions

 xsilParser ()
 Constructor.
 ~xsilParser ()
 Destructor.
void Init ()
 Parsing init.
void Done ()
 Parsing done.
void AddHandler (xsilHandlerQuery &handler)
bool Parse (const char *p, int len)
 Parse an array of characters.
bool Parse (const std::string &s)
 Parse a string.
bool Parse (std::istream &is)
 Parse an input stream.
bool ParseFile (const char *filename)
 Parse a file.
void Startelement (const char *name, const attrlist &attr)
 define a start element
void Texthandler (const char *text, int len)
 handle text
void Endelement (const char *name)
 define an end element

Static Public Member Functions

static xsilHandlerQueryDefaultHandler ()
 Default handler (ignores current data object).
static xsilHandlerQueryIgnoreAllHandler ()
 Ignore handler (ignores current data object and all nested).

Protected Attributes

handlerquerylist fHandler
 list of data object handlers
int fIgnore
 Level of ignore.
bool fNewLine
 New line flag.
bool fEndXML
 True if end of XML data has been reached.
worklist fWork
 stack of nested handlers
void * fXML
 XML parser.


Detailed Description

Xsil input parser. This is the input parser for reading data formatted in the LIGO light weight data format. The parser works on the premise of callback functions. The user feeds data to the parser which in return will invoke data and parameter methods of a handler object whenever a LIGO LW object is encountered in the input stream. Before feeding data the user has to supply at least one handler object. The 'IsHandler' method of the handler objects are called in turn for every encounterd LIGO-LW data object. The first handler returning true will obtain all parameters associated with the data object. Again, parameters are passed to the handler by invoking the HandleParameter methods. Since there are many different parameter types, this method is overloaded. If a parameter handler recognizes the parameter it has to return true, otherwise the parser will try calling other parameter handler methods after converting the parameter data into the new type (this automatic type conversion follows essentially the C++ rules, but will always try the string handler last). The handler object can also establish a callback for nested data objects; if not, nested data objects are treated like stand-alone.

Example: {verbatim} xsilHandlerQueryFile fileQ (filename, os); xsilParser parser; parser.AddHandler (fileQ); parser.Parse (filename); {verbatim}

brief Xsil data end manipulator.

Author:
Written June 2000 by Daniel Sigg
Version:
1.0

Member Function Documentation

void xml::xsilParser::AddHandler ( xsilHandlerQuery handler  ) 

Add a handler (handler query must stay valid during parsing!) The handler query object is not adopted


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:45 2009 for dmt by  doxygen 1.5.4