OpenStructure
Public Member Functions | Static Public Member Functions
StarParser Class Reference

#include <star_parser.hh>

Inherited by ChemdictParser, and ChemdictParser.

Public Member Functions

 StarParser (std::istream &istream)
virtual ~StarParser ()
virtual bool OnBeginLoop (const StarLoopDesc &header)
virtual void OnEndLoop ()
virtual void OnDataRow (const StarLoopDesc &header, const std::vector< StringRef > &columns)
virtual void OnDataItem (const StarDataItem &item)
virtual bool OnBeginData (const StringRef &data_name)
virtual void OnEndData ()
void Parse ()
 StarParser (std::istream &istream)
virtual ~StarParser ()
virtual bool OnBeginLoop (const StarLoopDesc &header)
virtual void OnEndLoop ()
virtual void OnDataRow (const StarLoopDesc &header, const std::vector< StringRef > &columns)
virtual void OnDataItem (const StarDataItem &item)
virtual bool OnBeginData (const StringRef &data_name)
virtual void OnEndData ()
void Parse ()

Static Public Member Functions

static bool SplitLine (const StringRef &line, std::vector< StringRef > &parts, bool clear=true)
static bool SplitLine (const StringRef &line, std::vector< StringRef > &parts, bool clear=true)

Detailed Description

parser for the STAR file format

STAR format description

In essence, STAR files are structured text files. A few simple control structures control the interpretation of the content.

Definition at line 96 of file star_parser.hh.


Constructor & Destructor Documentation

StarParser ( std::istream &  istream)
virtual ~StarParser ( )
inlinevirtual

Definition at line 100 of file star_parser.hh.

StarParser ( std::istream &  istream)
virtual ~StarParser ( )
inlinevirtual

Definition at line 100 of file star_parser.hh.


Member Function Documentation

virtual bool OnBeginData ( const StringRef data_name)
inlinevirtual

invoked when a new data control structure is encountered

Returns:
When true, for each data-item belonging to the data block, OnDataItem() is invoked. For every loop, OnBeginLoop() is called.

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 125 of file star_parser.hh.

virtual bool OnBeginData ( const StringRef data_name)
inlinevirtual

invoked when a new data control structure is encountered

Returns:
When true, for each data-item belonging to the data block, OnDataItem() is invoked. For every loop, OnBeginLoop() is called.

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 125 of file star_parser.hh.

virtual bool OnBeginLoop ( const StarLoopDesc header)
inlinevirtual

called when a loop is encountered

Returns:
When true, for each row in the loop, OnDataRow() is returned. If false, the loop is skipped.

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 107 of file star_parser.hh.

virtual bool OnBeginLoop ( const StarLoopDesc header)
inlinevirtual

called when a loop is encountered

Returns:
When true, for each row in the loop, OnDataRow() is returned. If false, the loop is skipped.

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 107 of file star_parser.hh.

virtual void OnDataItem ( const StarDataItem item)
inlinevirtual

invoked when a data item is encountered

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 120 of file star_parser.hh.

virtual void OnDataItem ( const StarDataItem item)
inlinevirtual

invoked when a data item is encountered

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 120 of file star_parser.hh.

virtual void OnDataRow ( const StarLoopDesc header,
const std::vector< StringRef > &  columns 
)
inlinevirtual

invoked when a data row in a loop is encountered.

Parameters:
headerdescribes the row format
columnscontains the data columns

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 115 of file star_parser.hh.

virtual void OnDataRow ( const StarLoopDesc header,
const std::vector< StringRef > &  columns 
)
inlinevirtual

invoked when a data row in a loop is encountered.

Parameters:
headerdescribes the row format
columnscontains the data columns

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 115 of file star_parser.hh.

virtual void OnEndData ( )
inlinevirtual

called when leaving a datasection. Will only be invoked when OnBeginData() returned true.

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 129 of file star_parser.hh.

virtual void OnEndData ( )
inlinevirtual

called when leaving a datasection. Will only be invoked when OnBeginData() returned true.

Reimplemented in ChemdictParser, and ChemdictParser.

Definition at line 129 of file star_parser.hh.

virtual void OnEndLoop ( )
inlinevirtual

invoked when leaving a loop

OnEndLoop() is only invoked, when OnBeginLoop() returned true.

Definition at line 111 of file star_parser.hh.

virtual void OnEndLoop ( )
inlinevirtual

invoked when leaving a loop

OnEndLoop() is only invoked, when OnBeginLoop() returned true.

Definition at line 111 of file star_parser.hh.

void Parse ( )
void Parse ( )
static bool SplitLine ( const StringRef line,
std::vector< StringRef > &  parts,
bool  clear = true 
)
static
static bool SplitLine ( const StringRef line,
std::vector< StringRef > &  parts,
bool  clear = true 
)
static

The documentation for this class was generated from the following files: