7fd59977 |
1 | // File: LDOM_Document.hxx |
2 | // Created: 25.06.01 12:41:02 |
3 | // Author: Alexander GRIGORIEV |
4 | // Copyright: OpenCascade 2001 |
5 | |
6 | |
7 | #ifndef LDOM_Document_HeaderFile |
8 | #define LDOM_Document_HeaderFile |
9 | |
10 | #include <LDOM_Element.hxx> |
11 | #include <Handle_LDOM_MemManager.hxx> |
12 | #include <LDOM_Text.hxx> |
13 | #include <LDOM_CDATASection.hxx> |
14 | #include <LDOM_Comment.hxx> |
15 | |
16 | // Class LDOM_Document |
17 | // |
18 | |
19 | class LDOM_Document |
20 | { |
21 | public: |
22 | // ---------- PUBLIC METHODS ---------- |
23 | Standard_EXPORT LDOM_Document (); |
24 | // Empty constructor |
25 | |
26 | Standard_EXPORT LDOM_Document (const LDOM_MemManager& aMemManager); |
27 | // Called by LDOM_MemManager::Doc() |
28 | |
29 | // Standard_EXPORT LDOM_Document (const LDOM_Document& theOther); |
30 | // Copy constructor |
31 | |
32 | Standard_EXPORT ~LDOM_Document (); |
33 | // Destructor |
34 | |
35 | // ---- CREATE ---- |
36 | |
37 | static Standard_EXPORT LDOM_Document |
38 | createDocument (const LDOMString& theQualifiedName); |
39 | // Create an empty document |
40 | |
41 | Standard_EXPORT LDOM_Element |
42 | createElement (const LDOMString& theTagName); |
43 | |
44 | // Standard_EXPORT LDOM_Element |
45 | // createElementNS (const LDOMString& theNSuri, |
46 | // const LDOMString& theQualName); |
47 | |
48 | Standard_EXPORT LDOM_CDATASection |
49 | createCDATASection (const LDOMString& theData); |
50 | |
51 | Standard_EXPORT LDOM_Comment |
52 | createComment (const LDOMString& theData); |
53 | |
54 | Standard_EXPORT LDOM_Text |
55 | createTextNode (const LDOMString& theData); |
56 | |
57 | // ---- GET ---- |
58 | |
59 | Standard_EXPORT LDOM_Element |
60 | getDocumentElement () const; |
61 | |
62 | Standard_EXPORT LDOM_NodeList |
63 | getElementsByTagName (const LDOMString& theTagName) const; |
64 | |
65 | // ---- COMPARE ---- |
66 | |
67 | Standard_Boolean |
68 | operator == (const LDOM_Document& anOther) const |
69 | { return myMemManager == anOther.myMemManager; } |
70 | |
71 | Standard_Boolean |
72 | operator != (const LDOM_Document& anOther) const |
73 | { return myMemManager != anOther.myMemManager; } |
74 | |
75 | Standard_Boolean |
76 | operator == (const LDOM_NullPtr *) const; |
77 | Standard_Boolean |
78 | operator != (const LDOM_NullPtr *) const; |
79 | |
80 | Standard_EXPORT Standard_Boolean |
81 | isNull () const; |
82 | |
83 | // ---- UTIL ---- |
84 | |
85 | Standard_EXPORT LDOM_Document& |
86 | operator = (const LDOM_NullPtr *); |
87 | |
88 | private: |
89 | friend class LDOM_LDOMImplementation; |
90 | friend class LDOMString; |
91 | friend class LDOM_Node; |
92 | // ---------- PRIVATE FIELDS ---------- |
93 | |
94 | Handle(LDOM_MemManager) myMemManager; |
95 | }; |
96 | |
97 | #endif |