COPASI API  4.16.103
CMiaseParser.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/miase/CMiaseParser.h,v $
3 // $Revision: 1.10 $
4 // $Name: $
5 // $Author: akoenig $
6 // $Date: 2008/04/02 12:14:39 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 #ifndef COPASI_CMiaseParser
15 #define COPASI_CMiaseParser
16 
17 #include <iostream>
18 #include <stdio.h>
19 #include <expat.h>
20 #include "CMiaseBase.h"
21 #include "CMiaseML.h"
22 
23 #if defined(__amigaos__) && defined(__USE_INLINE__)
24 #include <proto/expat.h>
25 #endif
26 
27 #ifdef XML_LARGE_SIZE
28 #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
29 #define XML_FMT_INT_MOD "I64"
30 #else
31 #define XML_FMT_INT_MOD "ll"
32 #endif
33 #else
34 #define XML_FMT_INT_MOD "l"
35 #endif
36 
37 #define BUFFSIZE 8192
38 
40  {
41 
42  public:
43 
44  static XML_Char mVersion_1_0[];
45  static char mNameSpace[];
46  static char mEncoding[];
47 
48  CMiaseParser();
49 
50  ~CMiaseParser();
51 
52  static void XMLCALL
53  start(void *data, const char *el, const char **attr);
54 
55  static void XMLCALL end(void *data, const char *el);
56 
57  static void XMLCALL xmldecl_handler(void *userData, const XML_Char *version,
58  const XML_Char *encoding, int standalone);
59 
60  static void XMLCALL charhndl(void *userData, const XML_Char *s, int len);
61 
62  void load(std::string filename);
63 
64  void testDataStructure();
65  protected:
66 
67  private:
68 
69  enum States
70  {
86  //more states for output lists
88  };
89 
90  /**
91  * A pointer to the input stream
92  */
93  std::istream *mpIstream;
94 
98  int mTmpDepth;
99  int mDepth;
100  XML_Parser mXmlParser;
102  std::string mContent;
103  std::vector< std::vector<std::string> > mAllowedStateTags;
104 
105  void startElement(const char *el, const char **attr);
106 
107  void endElement(const char *el);
108 
109  void xmlDecl(const XML_Char *version,
110  const XML_Char *encoding);
111 
112  void xmlNameSpace(void *, const XML_Char *prefix,
113  const XML_Char *uri);
114 
115  void newContent(const XML_Char *s, int len);
116 
117  bool isValid(const char *el);
118 
119  void createAllowedStateTags();
120 
121  void newNotes(const char **attr);
122 
123  void newAnnotation(const char **attr);
124 
125  void newModel(const char **attr);
126 
127  void newSimulation(const char *el, const char **attr);
128 
129  void newChange(const char *el, const char **attr);
130 
131  void newTask(const char **attr);
132 
133  void newMeasurementData(const char **attr);
134 
135  void newOutput(const char **attr);
136 
137  void newMiase(const char **attr);
138 
139  void newState(States newState);
140 
141  void error(std::string errorString);
142 
143  void addContent(const char *el, const char **attr);
144 
146  };
147 
149 
150 #endif //COPASI_CMiaseParser
void newContent(const XML_Char *s, int len)
static void XMLCALL start(void *data, const char *el, const char **attr)
void testDataStructure()
void newMiase(const char **attr)
void load(std::string filename)
static XML_Char mVersion_1_0[]
Definition: CMiaseParser.h:44
void addContent(const char *el, const char **attr)
static CMiaseParser * myParser
Definition: CMiaseParser.h:148
static void XMLCALL xmldecl_handler(void *userData, const XML_Char *version, const XML_Char *encoding, int standalone)
static char mNameSpace[]
Definition: CMiaseParser.h:45
void newTask(const char **attr)
void newOutput(const char **attr)
States mActState
Definition: CMiaseParser.h:96
void error(std::string errorString)
States mLastState
Definition: CMiaseParser.h:97
void newMeasurementData(const char **attr)
void xmlDecl(const XML_Char *version, const XML_Char *encoding)
void newChange(const char *el, const char **attr)
static void XMLCALL charhndl(void *userData, const XML_Char *s, int len)
std::istream * mpIstream
Definition: CMiaseParser.h:93
void startElement(const char *el, const char **attr)
void newState(States newState)
void endElement(const char *el)
bool isValid(const char *el)
std::string mContent
Definition: CMiaseParser.h:102
XML_Parser mXmlParser
Definition: CMiaseParser.h:100
CMiaseML * mMiase
Definition: CMiaseParser.h:95
void newModel(const char **attr)
#define BUFFSIZE
Definition: CMiaseParser.h:37
static void XMLCALL end(void *data, const char *el)
void createAllowedStateTags()
void xmlNameSpace(void *, const XML_Char *prefix, const XML_Char *uri)
void newNotes(const char **attr)
void newSimulation(const char *el, const char **attr)
CMiaseBase * getLastObj()
char mBuff[8192]
Definition: CMiaseParser.h:101
void newAnnotation(const char **attr)
std::vector< std::vector< std::string > > mAllowedStateTags
Definition: CMiaseParser.h:103
static char mEncoding[]
Definition: CMiaseParser.h:46