RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
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#include <RDGeneral/export.h>
11#ifndef __FEATUREPARSER_H_02122004_1810__
12#define __FEATUREPARSER_H_02122004_1810__
13
14#include <iostream>
15#include <string>
16#include <map>
17#include <utility>
19
20namespace RDKit {
21//! \brief class used to indicate errors in parsing feature definition
22//! files.
24 : public std::exception {
25 public:
26 FeatureFileParseException(unsigned int lineNo, std::string line,
27 std::string msg)
28 : d_lineNo(lineNo), d_line(std::move(line)), d_msg(std::move(msg)) {}
29 unsigned int lineNo() const { return d_lineNo; }
30 std::string line() const { return d_line; }
31 const char *what() const noexcept override { return d_msg.c_str(); }
32 ~FeatureFileParseException() noexcept override = default;
33
34 private:
35 unsigned int d_lineNo;
36 std::string d_line, d_msg;
37};
38
40 const std::string &defnText,
41 MolChemicalFeatureDef::CollectionType &featDefs);
43 std::istream &istream, MolChemicalFeatureDef::CollectionType &featDefs);
45 const std::string &fileName,
46 MolChemicalFeatureDef::CollectionType &featDefs);
47
48namespace Local {
49// these functions are exposed only so they can be tested
50RDKIT_MOLCHEMICALFEATURES_EXPORT void parseAtomType(
51 const std::string &inLine, std::map<std::string, std::string> &atomTypeDefs,
52 const unsigned int &lineNo);
54 std::istream &inStream, const std::string &inLine, unsigned int &lineNo,
55 const std::map<std::string, std::string> &atomTypeDefs);
56} // namespace Local
57} // end of namespace RDKit
58#endif
class used to indicate errors in parsing feature definition files.
const char * what() const noexcept override
~FeatureFileParseException() noexcept override=default
FeatureFileParseException(unsigned int lineNo, std::string line, std::string msg)
#define RDKIT_MOLCHEMICALFEATURES_EXPORT
Definition export.h:289
Std stuff.