OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions
ChemdictParser Class Reference

#include <chemdict_parser.hh>

Inherits StarParser, and StarParser.

Public Member Functions

 ChemdictParser (std::istream &stream, conop::Compound::Dialect dialect, bool ignore_reserved=false, bool ignore_obsolete=false)
 
virtual bool OnBeginData (const StringRef &data_name)
 
virtual bool OnBeginLoop (const StarLoopDesc &header)
 
virtual void OnDataRow (const StarLoopDesc &header, const std::vector< StringRef > &columns)
 
virtual void OnDataItem (const StarDataItem &item)
 
virtual void OnEndData ()
 
void SetCompoundLib (const conop::CompoundLibPtr &lib)
 
 ChemdictParser (std::istream &stream, conop::Compound::Dialect dialect, bool ignore_reserved=false, bool ignore_obsolete=false)
 
virtual bool OnBeginData (const StringRef &data_name)
 
virtual bool OnBeginLoop (const StarLoopDesc &header)
 
virtual void OnDataRow (const StarLoopDesc &header, const std::vector< StringRef > &columns)
 
virtual void OnDataItem (const StarDataItem &item)
 
virtual void OnEndData ()
 
void SetCompoundLib (const conop::CompoundLibPtr &lib)
 
- Public Member Functions inherited from StarParser
 StarParser (std::istream &stream, bool items_as_row=false)
 
 StarParser (const String &filename, bool items_as_row=false)
 
virtual ~StarParser ()
 
virtual void OnEndLoop ()
 
Real TryGetReal (const StringRef &data, const String &name) const
 
float TryGetFloat (const StringRef &data, const String &name) const
 
std::pair< bool, float > TryGetFloat (const StringRef &data, const String &name, bool may_fail) const
 
int TryGetInt (const StringRef &data, const String &name) const
 
std::pair< bool, int > TryGetInt (const StringRef &data, const String &name, bool may_fail) const
 
bool TryGetBool (const StringRef &data, const String &name) const
 
String FormatDiagnostic (StarDiagType type, const String &message, int line=-1) const
 
void SetFilename (const String &filename)
 
int GetCurrentLinenum () const
 
void Parse ()
 
 StarParser (std::istream &stream, bool items_as_row=false)
 
 StarParser (const String &filename, bool items_as_row=false)
 
virtual ~StarParser ()
 
virtual void OnEndLoop ()
 
Real TryGetReal (const StringRef &data, const String &name) const
 
float TryGetFloat (const StringRef &data, const String &name) const
 
std::pair< bool, float > TryGetFloat (const StringRef &data, const String &name, bool may_fail) const
 
int TryGetInt (const StringRef &data, const String &name) const
 
std::pair< bool, int > TryGetInt (const StringRef &data, const String &name, bool may_fail) const
 
bool TryGetBool (const StringRef &data, const String &name) const
 
String FormatDiagnostic (StarDiagType type, const String &message, int line=-1) const
 
void SetFilename (const String &filename)
 
int GetCurrentLinenum () const
 
void Parse ()
 

Additional Inherited Members

- Static Public Member Functions inherited from StarParser
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

Definition at line 41 of file chemdict_parser.hh.

Constructor & Destructor Documentation

ChemdictParser ( std::istream &  stream,
conop::Compound::Dialect  dialect,
bool  ignore_reserved = false,
bool  ignore_obsolete = false 
)
inline

Definition at line 43 of file chemdict_parser.hh.

ChemdictParser ( std::istream &  stream,
conop::Compound::Dialect  dialect,
bool  ignore_reserved = false,
bool  ignore_obsolete = false 
)
inline

Definition at line 43 of file chemdict_parser.hh.

Member Function Documentation

virtual bool OnBeginData ( const StringRef data_name)
virtual

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 from StarParser.

virtual bool OnBeginData ( const StringRef data_name)
virtual

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 from StarParser.

virtual bool OnBeginLoop ( const StarLoopDesc header)
virtual

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 from StarParser.

virtual bool OnBeginLoop ( const StarLoopDesc header)
virtual

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 from StarParser.

virtual void OnDataItem ( const StarDataItem item)
virtual

invoked when a data item is encountered

Reimplemented from StarParser.

virtual void OnDataItem ( const StarDataItem item)
virtual

invoked when a data item is encountered

Reimplemented from StarParser.

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

invoked when a data row in a loop is encountered.

Parameters
headerdescribes the row format
columnscontains the data columns

Reimplemented from StarParser.

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

invoked when a data row in a loop is encountered.

Parameters
headerdescribes the row format
columnscontains the data columns

Reimplemented from StarParser.

virtual void OnEndData ( )
virtual

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

Reimplemented from StarParser.

virtual void OnEndData ( )
virtual

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

Reimplemented from StarParser.

void SetCompoundLib ( const conop::CompoundLibPtr lib)
inline

Definition at line 64 of file chemdict_parser.hh.

void SetCompoundLib ( const conop::CompoundLibPtr lib)
inline

Definition at line 64 of file chemdict_parser.hh.


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