xsil::Xreader Class Reference
[Xsil document preparation]

#include <Xreader.hh>

List of all members.

Public Types

enum  LxrTokens {
  tkEnd, tkWord, tkString, tkNumber,
  tkEqual, tkOpenTag, tkOpenETag, tkOpenCTag,
  tkOpenHead, tkEndTag, tkEndSTag, tkCloseHead,
  tkEscape, tkQMark
}

Public Member Functions

 Xreader (std::istream &istr)
 ~Xreader (void)
arrayreadArray (const attr_list &a, int hdronly)
xobjreadDoc (void)
void readEndTag (const std::string &endtag)
void readHeader (void)
ligolwreadLigoLW (const attr_list &a, int tagonly)
xobjreadObject (void)
paramreadParam (const attr_list &a, int tagonly)
StreamreadStream (const attr_list &a, int tagonly)
tablereadTable (const attr_list &a, int tagonly)
timereadTime (const attr_list &a, int tagonly)
int readTag (std::string &name, attr_list &attrs)
void setDebug (int lvl)


Detailed Description

The Xreader class reads an XSil file and encodes the contents as a tree of xsil:: class objects. In general, the user would read an entire document, and then search it for the objects of interest. This can be done as follows:

{verbatim} std::ifstream in("myxsil.xml"); xsil::Xreader xs(in); xsil::xobj* xo = in.readDoc(); xsil::table* xt = reinterpret_cast<>(xo->find("xmltable", "table")); {verbatim}

brief XSil reader class.

Author:
J. Zweizig
Version:
1.1; September 22, 2004

Member Enumeration Documentation

enum xsil::Xreader::LxrTokens

Xsil input lexographical tokens.


Constructor & Destructor Documentation

xsil::Xreader::Xreader ( std::istream &  istr  ) 

Construct an XML file writer to format data to an output stream. brief XML reader constructor.

Parameters:
istr Input stream to receive formatted XML.

xsil::Xreader::~Xreader ( void   ) 

XML reader destructor. brief Xreader destructor.


Member Function Documentation

array* xsil::Xreader::readArray ( const attr_list &  a,
int  hdronly 
)

Read an xsil array object. brief Read an xsil array object.

Parameters:
a Attribute list read from the array tag.
hdronly Boolean value indicating that the tag has no data.
Returns:
pointer to an xsil array object.

xobj* xsil::Xreader::readDoc ( void   ) 

The first/next document in the stream associated with the Xreader is ingested into memory as a tree of xsil class objects. brief Read a document.

void xsil::Xreader::readEndTag ( const std::string &  endtag  ) 

Read an end tag and compare the tag name to the specified tag value. readEndTag throws an "Mismatched end tag" exception if the values are not the same.

void xsil::Xreader::readHeader ( void   ) 

Read the file header

ligolw* xsil::Xreader::readLigoLW ( const attr_list &  a,
int  tagonly 
)

Read a Ligo LW structure

xobj* xsil::Xreader::readObject ( void   ) 

Read an xsil object.

param* xsil::Xreader::readParam ( const attr_list &  a,
int  tagonly 
)

Read an xsil parameter object.

Stream* xsil::Xreader::readStream ( const attr_list &  a,
int  tagonly 
)

Read an xsil stream object.

table* xsil::Xreader::readTable ( const attr_list &  a,
int  tagonly 
)

Read an xsil table object.

time* xsil::Xreader::readTime ( const attr_list &  a,
int  tagonly 
)

Read an xsil time specifier.

int xsil::Xreader::readTag ( std::string &  name,
attr_list &  attrs 
)

Read an xml object header tag. The tag type is returned in the string references by name and any attributes are copied to the attribute list. brief Read a tag.

Parameters:
name Reference to string that will receive the tag type.
attrs reference to an attribute list to receive attributes specified in the tag.

void xsil::Xreader::setDebug ( int  lvl  ) 

Set the level of debug printout. brief Set the debug level.

Parameters:
lvl level of detail in debug outputs.


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