VAPoR  0.1
ImpExp.h
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 
5 
6 #ifndef _ImpExp_h_
7 #define _ImpExp_h_
8 
9 #include <stack>
10 #include <expat.h>
11 #include <vapor/MyBase.h>
12 #include <vapor/common.h>
13 #include <vapor/XmlNode.h>
14 #include <vapor/ExpatParseMgr.h>
15 #ifdef WIN32
16 #pragma warning(disable : 4251)
17 #endif
18 namespace VAPoR {
19 
20 
21 //
30 class VDF_API ImpExp : public VetsUtil::MyBase, public ParsedXml {
31 public:
32 
35  //
36  ImpExp();
37 
38 
39  virtual ~ImpExp();
40 
41 
69  //
70  int Export(
71  const string &path, size_t ts, const string &varname,
72  const size_t min[3], const size_t max[3], const size_t timeseg[2]
73  );
74 
93  //
94  int Import(
95  string *path, size_t *ts, string *varname,
96  size_t min[3], size_t max[3], size_t timeseg[2]
97  );
98 static string GetPath();
99 private:
100  int _objInitialized; // has the obj successfully been initialized?
101  XmlNode *_rootnode; // root node of the xml tree
102 
103  static const string _rootTag;
104  static const string _pathNameTag;
105  static const string _timeStepTag;
106  static const string _varNameTag;
107  static const string _regionTag;
108  static const string _timeSegmentTag;
109 
110  bool elementStartHandler(ExpatParseMgr*, int depth , std::string& tag, const char **attr);
111  bool elementEndHandler(ExpatParseMgr*, int depth , std::string& );
112 
113  // XML Expat element handler helpers. A different handler is defined
114  // for each possible state (depth of XML tree) from 0 to 1
115  //
116  void _startElementHandler0(ExpatParseMgr*, const string &tag, const char **attrs);
117  void _startElementHandler1(ExpatParseMgr*,const string &tag, const char **attrs);
118  void _endElementHandler0(ExpatParseMgr*,const string &tag);
119  void _endElementHandler1(ExpatParseMgr*,const string &tag);
120 
121 
122 
123 };
124 
125 
126 };
127 
128 #endif // _ImpExp_h_
#define VDF_API
Definition: common.h:61
An Xml tree.
Definition: XmlNode.h:47
VetsUtil base class.
Definition: MyBase.h:68
A class for managing data set metadata.
Definition: ImpExp.h:30