MTK++ Latest version: 0.2.0

stdLibParser.h
Go to the documentation of this file.
00001 
00033 #ifndef STDLIBPARSER_H
00034 #define STDLIBPARSER_H
00035 
00036 #include <iostream>
00037 #include <string>
00038 #include <fstream>
00039 #include <iomanip>
00040 #include <stdlib.h>
00041 #include <stdio.h>
00042 #include <ctype.h>
00043 
00044 #include "baseParser.h"
00045 
00046 #ifdef USE_QT
00047 #include <QtCore>
00048 #include <QtXml>
00049 #elif defined(USE_XERCES)
00050 #include "domErrorHandler.h"
00051 #else // USE_TINYXML
00052 #include <sstream>
00053 #include "tinyxml/tinyxml.h"
00054 #endif
00055 
00056 namespace MTKpp
00057 {
00058 
00059 class collection;
00060 class stdLibrary;
00061 class stdGroup;
00062 class stdFrag;
00063 struct stdAtom;
00064 struct stdBond;
00065 struct stdImproper;
00066 struct stdLoop;
00067 struct stdAlias;
00068 struct stdRing;
00069 struct stdFeature;
00070 struct stdFuncGroup;
00071 class parameters;
00072 
00073 #ifdef USE_QT
00074 class stdLibParser : public QObject, public baseParser
00075 {
00076     Q_OBJECT
00077 #else // USE_XERCES or USE_TINYXML
00078 class stdLibParser : public baseParser
00079 {
00080 #endif
00081 
00082 public:
00083 
00090     stdLibParser(collection* c, stdLibrary* s, parameters* p);
00091 
00097     stdLibParser(stdLibrary* s, parameters* p);
00098 
00103     stdLibParser(stdLibrary* s);
00104 
00106     virtual ~stdLibParser();
00107 
00112     void Read(std::string i);
00113 
00118     void Write(std::string i);
00119 
00125     void Write(std::string i, std::string g);
00126 
00133     void Write(std::string i, std::string g, std::string f);
00134 
00135 #ifdef USE_TINYXML
00136 protected:
00137 
00142     void writeGroup(TiXmlElement* root, stdGroup* stdGp);
00143 
00149     void writeGroup(TiXmlElement* root, stdGroup* stdGp, std::string fragName);
00150 
00156     void writeFrag(TiXmlElement* root, stdFrag* stdFg);
00157 
00158 #endif // USE_TINYXML
00159 
00160 #ifdef USE_QT
00161 protected:
00162 
00167     void groupFiller(QDomNode d);
00168 
00173     void fragmentFiller(QDomNode d);
00174 
00179     void atomFiller(QDomNode d);
00180 
00185     void aliasFiller(QDomNode d);
00186 
00191     void improperFiller(QDomNode d);
00192 
00197     void loopFiller(QDomNode d);
00198 
00203     void ringFiller(QDomNode d);
00204 
00209     void featureFiller(QDomNode d);
00210 
00215     void funcGroupFiller(QDomNode d);
00216 
00221     void connPtsFiller(QDomNode d);
00222 
00227     void connTorFiller(QDomNode d);
00228 
00233     void rotBondFiller(QDomNode d);
00234 
00240     void writeGroup(QDomDocument doc, stdGroup* stdGp);
00241 
00248     void writeGroup(QDomDocument doc, stdGroup* stdGp, std::string fragName);
00249 
00256     void writeFrag(QDomDocument doc, QDomElement groupElem, stdFrag* stdFg);
00257 
00265     void writeAtom(QDomDocument doc, QDomElement fragElem, stdFrag* stdFg, stdAtom* stdAt);
00266 
00273     void writeLoop(QDomDocument doc, QDomElement fragElem, stdLoop* stdLp);
00274 
00281     void writeAlias(QDomDocument doc, QDomElement fragElem, stdAlias* stdAl);
00282 
00289     void writeImproper(QDomDocument doc, QDomElement fragElem, stdImproper* stdIm);
00290 
00297     void writeRing(QDomDocument doc, QDomElement fragElem, stdRing* stdRg);
00298 
00305     void writeFeature(QDomDocument doc, QDomElement fragElem, stdFeature* stdFt);
00306 
00313     void writeFuncGroup(QDomDocument doc, QDomElement fragElem, stdFuncGroup* stdFg);
00314 
00321     void writeConnPts(QDomDocument doc, QDomElement fragElem, stdFrag* stdFg);
00322 
00323 #endif // USE_QT
00324 
00325 #ifdef USE_XERCES
00326 protected:
00327 
00332     void stdLibFiller(DOMNode* d);
00333 
00338     void groupFiller(DOMNode* d);
00339 
00344     void fragmentFiller(DOMNode* d);
00345 
00351     void atomFiller(DOMNode* d);
00352 
00357     void aliasFiller(DOMNode* d);
00358 
00363     void improperFiller(DOMNode* d);
00364 
00369     void loopFiller(DOMNode* d);
00370 
00375     void ringFiller(DOMNode* d);
00376 
00381     void featureFiller(DOMNode* d);
00382 
00387     void funcGroupFiller(DOMNode* d);
00388 
00393     void connPtsFiller(DOMNode* d);
00394 
00399     void connTorFiller(DOMNode* d);
00400 
00405     void rotBondFiller(DOMNode* d);
00406 
00412     void writeGroup(XERCES_CPP_NAMESPACE::DOMDocument* doc, stdGroup* stdGp);
00413 
00420     void writeGroup(XERCES_CPP_NAMESPACE::DOMDocument* doc, stdGroup* stdGp, std::string fragName);
00421 
00428     void writeFrag(XERCES_CPP_NAMESPACE::DOMDocument* doc, DOMElement* groupElem, stdFrag* stdFg);
00429 
00437     void writeAtom(XERCES_CPP_NAMESPACE::DOMDocument* doc, DOMElement* fragElem, stdFrag* stdFg, stdAtom* stdAt);
00438 
00445     void writeLoop(XERCES_CPP_NAMESPACE::DOMDocument* doc, DOMElement* fragElem, stdLoop* stdLp);
00446 
00453     void writeAlias(XERCES_CPP_NAMESPACE::DOMDocument* doc, DOMElement* fragElem, stdAlias* stdAl);
00454 
00461     void writeImproper(XERCES_CPP_NAMESPACE::DOMDocument* doc, DOMElement* fragElem, stdImproper* stdIm);
00462 
00469     void writeRing(XERCES_CPP_NAMESPACE::DOMDocument* doc, DOMElement* fragElem, stdRing* stdRg);
00470 
00477     void writeFeature(XERCES_CPP_NAMESPACE::DOMDocument* doc, DOMElement* fragElem, stdFeature* stdFt);
00478 
00485     void writeFuncGroup(XERCES_CPP_NAMESPACE::DOMDocument* doc, DOMElement* fragElem, stdFuncGroup* stdFg);
00486 
00493     void writeConnPts(XERCES_CPP_NAMESPACE::DOMDocument* doc, DOMElement* fragElem, stdFrag* stdFg);
00494 #endif // USE_XERCES
00495 
00496 protected:
00497 
00499     collection*         pCollection;
00500 
00502     stdLibrary*         pStdLibrary;
00503 
00505     parameters*         pParameters;
00506 
00508     stdGroup*           pStdGroup;
00509 
00511     stdFrag*            pStdFrag;
00512 
00514     stdAtom*            pStdAtom;
00515 
00517     stdBond*            pStdBond;
00518 
00520     stdImproper*        pStdImproper;
00521 
00523     stdLoop*            pStdLoop;
00524 
00526     stdAlias*           pStdAlias;
00527 
00529     stdRing*            pStdRing;
00530 
00532     stdFeature*         pStdFeature;
00533 
00535     stdFuncGroup*       pStdFuncGroup;
00536 };
00537 
00538 } // MTKpp namespace
00539 
00540 #endif // STDLIBPARSER_H

Generated on Fri Dec 23 2011 09:28:52 for MTK++ by Doxygen 1.7.5.1