Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _RD_FILEPARSERUTILS_H
00011 #define _RD_FILEPARSERUTILS_H
00012
00013 #include <string>
00014 #include <iostream>
00015 #include <boost/lexical_cast.hpp>
00016 #include <boost/algorithm/string.hpp>
00017
00018 namespace RDKit{
00019 class RWMol;
00020 class Conformer;
00021
00022 namespace FileParserUtils {
00023 template <typename T>
00024 T stripSpacesAndCast(const std::string &input,bool acceptSpaces=false){
00025 std::string trimmed=boost::trim_copy(input);
00026 if(acceptSpaces && trimmed==""){
00027 return 0;
00028 } else {
00029 return boost::lexical_cast<T>(trimmed);
00030 }
00031 }
00032 int toInt(const std::string &input,bool acceptSpaces=false);
00033 double toDouble(const std::string &input,bool acceptSpaces=true);
00034
00035
00036
00037 std::string getV3000Line(std::istream *inStream,unsigned int &line);
00038
00039
00040 bool ParseV3000CTAB(std::istream *inStream,unsigned int &line,
00041 RWMol *mol, Conformer *&conf,
00042 bool &chiralityPossible,
00043 unsigned int &nAtoms,unsigned int &nBonds);
00044
00045
00046 bool ParseV2000CTAB(std::istream *inStream,unsigned int &line,
00047 RWMol *mol, Conformer *&conf,
00048 bool &chiralityPossible,
00049 unsigned int &nAtoms,unsigned int &nBonds);
00050
00051 Atom *replaceAtomWithQueryAtom(RWMol *mol,Atom *atom);
00052
00053 }
00054 }
00055
00056 #endif