Apache Log4cxx  Version 1.8.0
xml.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _LOG4CXX_HELPERS_XML_H
19 #define _LOG4CXX_HELPERS_XML_H
20 
21 #include <log4cxx/logstring.h>
22 #include <log4cxx/helpers/object.h>
24 
25 namespace LOG4CXX_NS
26 {
27 class File;
28 namespace helpers
29 {
30 class XMLDOMNode;
31 typedef std::shared_ptr<XMLDOMNode> XMLDOMNodePtr;
32 
33 class XMLDOMDocument;
34 typedef std::shared_ptr<XMLDOMDocument> XMLDOMDocumentPtr;
35 
36 class XMLDOMNodeList;
37 typedef std::shared_ptr<XMLDOMNodeList> XMLDOMNodeListPtr;
38 
39 class LOG4CXX_EXPORT DOMException : public RuntimeException
40 {
41  public:
42  DOMException() : RuntimeException(LOG4CXX_STR("DOM exception")) {}
43 };
44 
45 
50 class LOG4CXX_EXPORT XMLDOMNode
51 #if LOG4CXX_ABI_VERSION <= 15
52  : public virtual Object
53 #else
54  : public Object
55 #endif
56 {
57  public:
60  {
61  NOT_IMPLEMENTED_NODE = 0,
62  ELEMENT_NODE = 1,
63  DOCUMENT_NODE = 9
64  };
65 
67  virtual XMLDOMNodeType getNodeType() = 0;
69 };
71 
72 
76 class LOG4CXX_EXPORT XMLDOMElement
77 #if LOG4CXX_ABI_VERSION <= 15
78  : public virtual XMLDOMNode
79 #else
80  : public XMLDOMNode
81 #endif
82 {
83  public:
85  virtual LogString getTagName() = 0;
86  virtual LogString getAttribute(const LogString& name) = 0;
87 };
89 
96 class LOG4CXX_EXPORT XMLDOMDocument
97 #if LOG4CXX_ABI_VERSION <= 15
98  : public virtual XMLDOMNode
99 #else
100  : public XMLDOMNode
101 #endif
102 {
103  public:
105  virtual void load(const File& fileName) = 0;
106  virtual XMLDOMElementPtr getDocumentElement() = 0;
107  virtual XMLDOMElementPtr getElementById(const LogString& tagName,
108  const LogString& elementId) = 0;
109 };
111 
122 class LOG4CXX_EXPORT XMLDOMNodeList
123 #if LOG4CXX_ABI_VERSION <= 15
124  : public virtual Object
125 #else
126  : public Object
127 #endif
128 {
129  public:
131  virtual int getLength() = 0;
132  virtual XMLDOMNodePtr item(int index) = 0;
133 };
135 } // namespace helpers
136 } // namespace log4cxx
137 
138 #endif // _LOG4CXX_HELPERS_XML_H
139 
An abstract representation of file and directory path names.
Definition: file.h:41
Definition: xml.h:40
DOMException()
Definition: xml.h:42
base class for java-like objects.
Definition: object.h:102
RuntimeException is the parent class of those exceptions that can be thrown during the normal operati...
Definition: exception.h:59
The XMLDOMDocument interface represents an entire XML document.
Definition: xml.h:102
The XMLDOMElement interface represents an element in an XML document.
Definition: xml.h:82
The XMLDOMNodeList interface provides the abstraction of an ordered collection of nodes,...
Definition: xml.h:128
The XMLDOMNode interface is the primary datatype for the entire Document Object Model.
Definition: xml.h:56
virtual XMLDOMNodeType getNodeType()=0
XMLDOMNodeType
Definition: xml.h:60
virtual XMLDOMNodeListPtr getChildNodes()=0
virtual XMLDOMDocumentPtr getOwnerDocument()=0
std::shared_ptr< XMLDOMDocument > XMLDOMDocumentPtr
Definition: xml.h:33
LOG4CXX_PTR_DEF(XMLDOMNodeList)
std::shared_ptr< XMLDOMNodeList > XMLDOMNodeListPtr
Definition: xml.h:36
std::shared_ptr< XMLDOMNode > XMLDOMNodePtr
Definition: xml.h:30
std::basic_string< logchar > LogString
Definition: logstring.h:60
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition: object.h:37