FeatureParser.h
Go to the documentation of this file.
//
// Copyright (C) 2004-2006 Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#ifndef __FEATUREPARSER_H_02122004_1810__
#define __FEATUREPARSER_H_02122004_1810__
#include <iostream>
#include <string>
#include <map>
#include "MolChemicalFeatureDef.h"
namespace RDKit {
//! \brief class used to indicate errors in parsing feature definition
//! files.
class FeatureFileParseException : public std::exception {
public:
FeatureFileParseException(unsigned int lineNo, std::string line,
std::string msg)
: d_lineNo(lineNo), d_line(line), d_msg(msg){};
unsigned int lineNo() const { return d_lineNo; };
std::string line() const { return d_line; };
std::string message() const { return d_msg; };
~FeatureFileParseException() throw(){};
private:
unsigned int d_lineNo;
std::string d_line, d_msg;
};
int parseFeatureData(const std::string &defnText,
MolChemicalFeatureDef::CollectionType &featDefs);
int parseFeatureData(std::istream &istream,
MolChemicalFeatureDef::CollectionType &featDefs);
int parseFeatureFile(const std::string &fileName,
MolChemicalFeatureDef::CollectionType &featDefs);
namespace Local {
// these functions are exposed only so they can be tested
void parseAtomType(const std::string &inLine,
std::map<std::string, std::string> &atomTypeDefs,
const unsigned int &lineNo);
MolChemicalFeatureDef *parseFeatureDef(
std::istream &inStream, const std::string &inLine, unsigned int &lineNo,
const std::map<std::string, std::string> &atomTypeDefs);
}
} // end of namespace RDKit
#endif
RDKit::FeatureFileParseException::lineNo
unsigned int lineNo() const
Definition: FeatureParser.h:26
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::message
std::string message() const
Definition: FeatureParser.h:28
RDKit::parseFeatureFile
int parseFeatureFile(const std::string &fileName, MolChemicalFeatureDef::CollectionType &featDefs)
RDKit::FeatureFileParseException::line
std::string line() const
Definition: FeatureParser.h:27
RDKit::MolChemicalFeatureDef::CollectionType
std::list< boost::shared_ptr< MolChemicalFeatureDef > > CollectionType
Definition: MolChemicalFeatureDef.h:26
RDKit
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
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