libepp_nicbr
DomParserCommon.H
1 /* ${copyright}$ */
2 /* $Id: DomParserCommon.H 1110 2011-04-14 19:12:45Z rafael $ */
7 #ifndef __DOMPARSERCOMMON_H__
8 #define __DOMPARSERCOMMON_H__
9 
10 #include <string>
11 #include <map>
12 #include <memory>
13 
14 #include <xercesc/parsers/XercesDOMParser.hpp>
15 #include <xercesc/dom/DOM.hpp>
16 
17 #include "DomErrorHandler.H"
18 #include "CommonData.H"
19 #include "DSInfo.H"
20 #include "ReverseDSInfo.H"
21 
22 #include "libepp_nicbr.H"
23 
24 using std::string;
25 using std::map;
26 using std::less;
27 using std::auto_ptr;
28 
29 XERCES_CPP_NAMESPACE_USE
30 
31 LIBEPP_NICBR_NS_BEGIN
32 
35 {
36 public:
39 
42 
44 
47  void enable_validation(const string& schemas_dir = SCHEMASDIR);
48 
50  void disable_validation();
51 
53 
57  static string str_transcode(const XMLCh *const to_transcode);
58 
59 protected:
61 
65  DOMNode *parse(const string &xml_payload);
66 
68 
72  void fill_postal_info(DOMNode *n, PostalInfo *postal_info);
73 
75 
79  void fill_ds_info(DOMNode *n, DSInfo *ds_info);
80 
82 
86  void fill_key_data(DOMNode *n, KeyData *keyData);
87 
88 #if USE_IP_MANAGEMENT
89 
93  IpRange fill_ipRange(DOMNode *n);
94 
96 
99  ReverseDns fill_reverseDns(DOMNode *n);
100 
102 
106  void fill_reverse_ds_info(DOMNode *n, ReverseDSInfo &ds_info);
107 #endif // USE_IP_MANAGEMENT
108 
109 #if USE_BR_ORG
110 
114  IpRange fill_brorg_ipRange(DOMNode *n);
115 #endif // USE_BR_ORG
116 
118 
122  map< string, string, less<string> > get_children_simple(DOMNode *n);
123 
125 
129  map< string, string, less<string> > get_attributes(DOMNode *n);
130 
132  XercesDOMParser *_parser;
133 
136 };
137 
138 LIBEPP_NICBR_NS_END
139 #endif //__DOMPARSERCOMMON_H__
XercesDOMParser * _parser
Object for parsing XML documents.
Definition: DomParserCommon.H:132
void enable_validation(const string &schemas_dir=SCHEMASDIR)
Enable Validation.
EPP DomErrorHandler Class.
EPP/DNSSEC DS information class for reverse DNS.
Project defines.
EPP CommonData Class.
PostalInfo class.
Definition: CommonData.H:281
EPP DomParser Class.
Definition: DomParserCommon.H:34
Describes IpRange structure.
Definition: CommonData.H:192
void disable_validation()
Disable Validation.
DSInfo Class.
Definition: DSInfo.H:16
void fill_key_data(DOMNode *n, KeyData *keyData)
Fills a KeyData object.
Definition: KeyData.H:15
DomErrorHandler _error_handler
DOM error handler.
Definition: DomParserCommon.H:135
void fill_postal_info(DOMNode *n, PostalInfo *postal_info)
Fills a Postal Info struct.
map< string, string, less< string > > get_attributes(DOMNode *n)
Fills a map of attributes and associated values.
map< string, string, less< string > > get_children_simple(DOMNode *n)
Fills a map of children names with associated content text.
void fill_ds_info(DOMNode *n, DSInfo *ds_info)
Fills a DSInfo object.
EPP/DNSSEC DS information class.
EPP DomErrorHandler Class.
Definition: DomErrorHandler.H:20
DomParserCommon()
Constructor.
static string str_transcode(const XMLCh *const to_transcode)
Transcodes a XMLCh to string.
Reverse DSInfo Class.
Definition: ReverseDSInfo.H:16
~DomParserCommon()
Destructor.
DOMNode * parse(const string &xml_payload)
Do the actual parsing of the XML document.