MTK++ Latest version: 0.2.0

dMParser.h
Go to the documentation of this file.
00001 
00033 #ifndef DMPARSER_H
00034 #define DMPARSER_H
00035 
00036 #include <iostream>
00037 #include <string>
00038 #include <vector>
00039 #include <fstream>
00040 #include <iomanip>
00041 #include <stdlib.h>
00042 #include <sstream>
00043 #include <math.h>
00044 #include "baseParser.h"
00045 
00046 #include "Statistics/table.h"
00047 
00048 #ifdef USE_QT
00049 #include <QtCore>
00050 #include <QtXml>
00051 #include <QObject>
00052 #elif defined(USE_XERCES)
00053 #include "domErrorHandler.h"
00054 #else // USE_TINYXML
00055 #include <sstream>
00056 #include "tinyxml/tinyxml.h"
00057 #endif
00058 
00059 namespace MTKpp
00060 {
00061 
00062 class sheet;
00063 
00064 // ============================================================
00065 // Class : dMParser()
00066 // ------------------------------------------------------------
00072 // ============================================================
00073 #ifdef USE_QT
00074 class dMParser : public QObject, public baseParser
00075 {
00076     Q_OBJECT
00077 #else // USE_XERCES or USE_TINYMXL
00078 class dMParser : public baseParser
00079 {
00080 #endif
00081 
00082 public:
00086     dMParser();
00087 
00089     virtual ~dMParser();
00090 
00097     int read(sheet* s, std::string f);
00098 
00111     int import(sheet* s, std::string f);
00112 
00119     int write(sheet* s, std::string f, bool bComments = false);
00120 
00121 #ifdef USE_QT
00122 protected:
00123 
00128     void tableFiller(QDomNode d);
00129 
00134     void rowColFiller(QDomNode d);
00135 
00141     void cellFiller(QDomNode d, int i);
00142 
00148     void cellIntFiller(QDomNode d, int i);
00149 
00155     void writeTable(QDomDocument doc, table<double>* t);
00156 
00162     void writeIntTable(QDomDocument doc, table<int>* t);
00163 
00164 #endif // USE_QT
00165 
00166 #ifdef USE_XERCES
00167 protected:
00168 
00173     void sheetFiller(DOMNode* d);
00174 
00179     void tableFiller(DOMNode* d);
00180 
00185     void rowColFiller(DOMNode* d);
00186 
00187 
00193     void cellFiller(DOMNode* d, int i);
00194 
00200     void cellIntFiller(DOMNode* d, int i);
00201 
00207     void writeTable(XERCES_CPP_NAMESPACE::DOMDocument* doc, table<double>* t);
00208 
00214     void writeIntTable(XERCES_CPP_NAMESPACE::DOMDocument* doc, table<int>* t);
00215 
00216 #endif // USE_XERCES
00217 
00218 #ifdef USE_TINYXML
00219 protected:
00220 
00226     void writeTable(TiXmlElement* root, table<double>* t);
00227 
00233     void writeIntTable(TiXmlElement* root, table<int>* t);
00234 
00235 #endif // USE_TINYXML
00236 
00237 protected:
00239     sheet* mySheet;
00240 
00242     table<double>* myDoubleTable;
00243 
00245     table<int>* myIntTable;
00246 
00248     std::string currentType;
00249 };
00250 
00251 } // MTKpp namespace
00252 
00253 #endif // DMPARSER_H

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