Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __FEATUREPARSER_H_02122004_1810__
00011 #define __FEATUREPARSER_H_02122004_1810__
00012
00013 #include <iostream>
00014 #include <string>
00015 #include <map>
00016 #include "MolChemicalFeatureDef.h"
00017
00018 namespace RDKit{
00019
00020
00021 class FeatureFileParseException : public std::exception {
00022 public:
00023 FeatureFileParseException(unsigned int lineNo,std::string line,std::string msg) :
00024 d_lineNo(lineNo), d_line(line), d_msg(msg) {};
00025 unsigned int lineNo () const { return d_lineNo; };
00026 std::string line () const { return d_line; };
00027 std::string message () const { return d_msg; };
00028 ~FeatureFileParseException () throw () {};
00029 private:
00030 unsigned int d_lineNo;
00031 std::string d_line,d_msg;
00032 };
00033
00034 int parseFeatureData(const std::string &defnText,
00035 MolChemicalFeatureDef::CollectionType &featDefs);
00036 int parseFeatureData(std::istream &istream,
00037 MolChemicalFeatureDef::CollectionType &featDefs);
00038 int parseFeatureFile(const std::string &fileName,
00039 MolChemicalFeatureDef::CollectionType &featDefs);
00040
00041
00042 namespace Local {
00043
00044 void parseAtomType(const std::string &inLine,
00045 std::map<std::string,std::string> &atomTypeDefs,
00046 const unsigned int &lineNo);
00047 MolChemicalFeatureDef *parseFeatureDef(std::istream &inStream,
00048 const std::string &inLine,
00049 unsigned int &lineNo,
00050 const std::map<std::string,std::string> &atomTypeDefs);
00051 }
00052 }
00053 #endif