RDKit: FeatureParser.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

FeatureParser.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #ifndef __FEATUREPARSER_H_02122004_1810__
11 #define __FEATUREPARSER_H_02122004_1810__
12
13 #include <iostream>
14 #include <string>
15 #include <map>
16 #include "MolChemicalFeatureDef.h"
17
18 namespace RDKit {
19 //! \brief class used to indicate errors in parsing feature definition
20 //! files.
21 class FeatureFileParseException : public std::exception {
22 public:
23 FeatureFileParseException(unsigned int lineNo, std::string line,
24 std::string msg)
25 : d_lineNo(lineNo), d_line(line), d_msg(msg){};
26 unsigned int lineNo() const { return d_lineNo; };
27 std::string line() const { return d_line; };
28 std::string message() const { return d_msg; };
29 ~FeatureFileParseException() throw(){};
30
31 private:
32 unsigned int d_lineNo;
33 std::string d_line, d_msg;
34 };
35
36 int parseFeatureData(const std::string &defnText,
37 MolChemicalFeatureDef::CollectionType &featDefs);
38 int parseFeatureData(std::istream &istream,
39 MolChemicalFeatureDef::CollectionType &featDefs);
40 int parseFeatureFile(const std::string &fileName,
41 MolChemicalFeatureDef::CollectionType &featDefs);
42
43 namespace Local {
44 // these functions are exposed only so they can be tested
45 void parseAtomType(const std::string &inLine,
46 std::map<std::string, std::string> &atomTypeDefs,
47 const unsigned int &lineNo);
48 MolChemicalFeatureDef *parseFeatureDef(
49 std::istream &inStream, const std::string &inLine, unsigned int &lineNo,
50 const std::map<std::string, std::string> &atomTypeDefs);
51 }
52 } // end of namespace RDKit
53 #endif
RDKit::parseFeatureData
int parseFeatureData(const std::string &defnText, MolChemicalFeatureDef::CollectionType &featDefs)
RDKit::FeatureFileParseException::~FeatureFileParseException
~FeatureFileParseException()
Definition: FeatureParser.h:29
RDKit::Local::parseAtomType
void parseAtomType(const std::string &inLine, std::map< std::string, std::string > &atomTypeDefs, const unsigned int &lineNo)
RDKit::FeatureFileParseException
class used to indicate errors in parsing feature definition files.
Definition: FeatureParser.h:21
MolChemicalFeatureDef.h
RDKit::FeatureFileParseException::line
std::string line() const
Definition: FeatureParser.h:27
RDKit::parseFeatureFile
int parseFeatureFile(const std::string &fileName, MolChemicalFeatureDef::CollectionType &featDefs)
RDKit::MolChemicalFeatureDef::CollectionType
std::list< boost::shared_ptr< MolChemicalFeatureDef > > CollectionType
Definition: MolChemicalFeatureDef.h:26
RDKit
Std stuff.
Definition: Atom.h:29
RDKit::FeatureFileParseException::message
std::string message() const
Definition: FeatureParser.h:28
RDKit::FeatureFileParseException::lineNo
unsigned int lineNo() const
Definition: FeatureParser.h:26
RDKit::Local::parseFeatureDef
MolChemicalFeatureDef * parseFeatureDef(std::istream &inStream, const std::string &inLine, unsigned int &lineNo, const std::map< std::string, std::string > &atomTypeDefs)
RDKit::FeatureFileParseException::FeatureFileParseException
FeatureFileParseException(unsigned int lineNo, std::string line, std::string msg)
Definition: FeatureParser.h:23
RDKit::MolChemicalFeatureDef
Definition: MolChemicalFeatureDef.h:24