0022815: Missing delete operator for placement new
[occt.git] / src / LDOM / LDOMParser.hxx
1 // File:      LDOMParser.hxx
2 // Created:   20.07.01 12:52:47
3 // Author:    Alexander GRIGORIEV
4 // Copyright: OpenCascade 2001
5 // History:   AGV 060302: Input from istream
6
7 #ifndef LDOMParser_HeaderFile
8 #define LDOMParser_HeaderFile
9
10 #include <LDOM_Document.hxx>
11 #include <LDOM_OSStream.hxx>
12
13 class LDOM_XmlReader;
14 //class istream;
15
16 //  Class LDOMParser
17 //
18
19 class LDOMParser
20 {
21  public:
22   // ---------- PUBLIC METHODS ----------
23
24   LDOMParser () : myReader (NULL), myCurrentData (16384) {}
25   // Empty constructor
26
27   virtual Standard_EXPORT ~LDOMParser  ();
28   // Destructor
29
30   Standard_EXPORT LDOM_Document
31                         getDocument    ();
32   // Get the LDOM_Document
33
34   Standard_EXPORT Standard_Boolean
35                         parse           (const char * const aFileName);
36   // Parse a file
37   // Returns True if error occurred, then GetError() can be called
38
39   Standard_EXPORT Standard_Boolean
40                         parse           (istream& anInput);
41   // Parse a C++ stream
42   // Returns True if error occurred, then GetError() can be called
43
44   Standard_EXPORT const TCollection_AsciiString&
45                         GetError        (TCollection_AsciiString& aData) const;
46   // Return text describing a parsing error, or Empty if no error occurred
47
48  protected:
49   // ---------- PROTECTED METHODS ----------
50
51   Standard_EXPORT virtual Standard_Boolean
52                         startElement    ();
53   // virtual hook on 'StartElement' event for descendant classes
54
55   Standard_EXPORT virtual Standard_Boolean
56                         endElement      ();
57   // virtual hook on 'EndElement' event for descendant classes
58
59   Standard_EXPORT LDOM_Element
60                         getCurrentElement () const;
61   // to be called from startElement() and endElement()
62
63  private:
64   // ---------- PRIVATE METHODS ----------
65   Standard_Boolean      ParseDocument   ();
66
67   Standard_Boolean      ParseElement    ();
68
69   // ---------- PRIVATE (PROHIBITED) METHODS ----------
70
71   LDOMParser (const LDOMParser& theOther);
72   // Copy constructor
73
74   LDOMParser& operator = (const LDOMParser& theOther);
75   // Assignment
76
77  private:
78   // ---------- PRIVATE FIELDS ----------
79
80   LDOM_XmlReader                * myReader;
81   Handle(LDOM_MemManager)       myDocument;
82   LDOM_OSStream                 myCurrentData;
83   TCollection_AsciiString       myError;
84 };
85
86 #endif