Apache log4cxx  Version 0.12.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 #if defined(_MSC_VER)
22  #pragma warning ( push )
23  #pragma warning ( disable: 4231 4251 4275 4786 )
24 #endif
25 
26 
27 #include <log4cxx/logstring.h>
28 #include <log4cxx/helpers/object.h>
30 
31 namespace log4cxx
32 {
33 class File;
34 namespace helpers
35 {
36 class XMLDOMNode;
37 typedef std::shared_ptr<XMLDOMNode> XMLDOMNodePtr;
38 
40 typedef std::shared_ptr<XMLDOMDocument> XMLDOMDocumentPtr;
41 
43 typedef std::shared_ptr<XMLDOMNodeList> XMLDOMNodeListPtr;
44 
45 class LOG4CXX_EXPORT DOMException : public RuntimeException
46 {
47  public:
48  DOMException() : RuntimeException(LOG4CXX_STR("DOM exception")) {}
49 };
50 
51 
56 class LOG4CXX_EXPORT XMLDOMNode : virtual public Object
57 {
58  public:
61  {
62  NOT_IMPLEMENTED_NODE = 0,
63  ELEMENT_NODE = 1,
64  DOCUMENT_NODE = 9
65  };
66 
67  virtual XMLDOMNodeListPtr getChildNodes() = 0;
68  virtual XMLDOMNodeType getNodeType() = 0;
69  virtual XMLDOMDocumentPtr getOwnerDocument() = 0;
70 };
72 
73 
77 class LOG4CXX_EXPORT XMLDOMElement : virtual public XMLDOMNode
78 {
79  public:
81  virtual LogString getTagName() = 0;
82  virtual LogString getAttribute(const LogString& name) = 0;
83 };
85 
92 class LOG4CXX_EXPORT XMLDOMDocument : virtual public XMLDOMNode
93 {
94  public:
96  virtual void load(const File& fileName) = 0;
97  virtual XMLDOMElementPtr getDocumentElement() = 0;
98  virtual XMLDOMElementPtr getElementById(const LogString& tagName,
99  const LogString& elementId) = 0;
100 };
102 
113 class LOG4CXX_EXPORT XMLDOMNodeList : virtual public Object
114 {
115  public:
117  virtual int getLength() = 0;
118  virtual XMLDOMNodePtr item(int index) = 0;
119 };
121 } // namespace helpers
122 } // namespace log4cxx
123 
124 
125 #if defined(_MSC_VER)
126  #pragma warning ( pop )
127 #endif
128 
129 #endif // _LOG4CXX_HELPERS_XML_H
130 
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition: object.h:26
LOG4CXX_PTR_DEF(AppenderAttachableImpl)
std::shared_ptr< XMLDOMDocument > XMLDOMDocumentPtr
Definition: xml.h:39
Definition: xml.h:45
base class for java-like objects.
Definition: object.h:101
XMLDOMNodeType
Definition: xml.h:60
The XMLDOMDocument interface represents an entire XML document.
Definition: xml.h:92
std::shared_ptr< XMLDOMNodeList > XMLDOMNodeListPtr
Definition: xml.h:42
The XMLDOMNodeList interface provides the abstraction of an ordered collection of nodes...
Definition: xml.h:113
An abstract representation of file and directory path names.
Definition: file.h:45
DOMException()
Definition: xml.h:48
Definition: appender.h:32
std::basic_string< logchar > LogString
Definition: logstring.h:66
RuntimeException is the parent class of those exceptions that can be thrown during the normal operati...
Definition: exception.h:53
std::shared_ptr< XMLDOMNode > XMLDOMNodePtr
Definition: xml.h:36
The XMLDOMElement interface represents an element in an XML document.
Definition: xml.h:77
The XMLDOMNode interface is the primary datatype for the entire Document Object Model.
Definition: xml.h:56