19 #ifndef OST_CONOP_CHEMDICT_PARSER_HH
20 #define OST_CONOP_CHEMDICT_PARSER_HH
32 namespace ost {
namespace io {
44 bool ignore_reserved=
false,
bool ignore_obsolete=
false):
45 StarParser(stream), compound_(new conop::Compound(
"UNK")),
46 last_(0), loop_type_(
DONT_KNOW), dialect_(dialect),
47 ignore_reserved_(ignore_reserved), ignore_obsolete_(ignore_obsolete),
51 this->InitPDBXTypeMap();
59 const std::vector<StringRef>& columns);
73 return imported_count_;
77 void InitPDBXTypeMap();
78 bool IsNameReserved(
const String& data_name);
99 static std::map<String, mol::ChemClass> tm_;
100 static std::map<String, mol::ChemType> xtm_;
101 std::map<String, int> atom_map_;
106 bool ignore_reserved_;
107 bool ignore_obsolete_;
convenient datatype for referencing character data
virtual bool OnBeginData(const StringRef &data_name)
invoked when a new data control structure is encountered
int GetImportedCount()
Get the number of compounds that were successfully parsed.
virtual void OnEndData()
called when leaving a datasection. Will only be invoked when OnBeginData() returned true.
virtual void OnDataItem(const StarDataItem &item)
invoked when a data item is encountered
virtual void OnDataRow(const StarLoopDesc &header, const std::vector< StringRef > &columns)
invoked when a data row in a loop is encountered.
ChemdictParser(std::istream &stream, conop::Compound::Dialect dialect, bool ignore_reserved=false, bool ignore_obsolete=false)
virtual bool OnBeginLoop(const StarLoopDesc &header)
called when a loop is encountered
void SetCompoundLib(const conop::CompoundLibPtr &lib)
parser for the STAR file format
boost::shared_ptr< Compound > CompoundPtr
boost::shared_ptr< CompoundLib > CompoundLibPtr