OpenDDS  Snapshot(2023/04/28-20:55)
XML_String_Intf.h
Go to the documentation of this file.
1 //==============================================================
2 /**
3  * @file XML_String_Intf.h
4  *
5  *
6  * @author Danilo C. Zanella (dczanella@gmail.com)
7  */
8 //================================================================
9 
10 #ifndef OPENDDS_DCPS_QOS_XML_HANDLER_XML_STRING_INTF_H
11 #define OPENDDS_DCPS_QOS_XML_HANDLER_XML_STRING_INTF_H
12 #include /**/ "ace/pre.h"
13 
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
15 # pragma once
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
17 
18 #include "dds_qos.hpp"
19 #include "XML_Intf.h"
20 #include "dds/DdsDcpsInfrastructureC.h"
22 
23 namespace XML
24 {
25  struct Environment_Resolver;
26  template <typename Resolver>
27  class XML_Schema_Resolver;
28  class XML_Error_Handler;
29 }
30 
31 XERCES_CPP_NAMESPACE_BEGIN
32  class XercesDOMParser;
33  class DOMDocument;
34 XERCES_CPP_NAMESPACE_END
35 
37 
38 namespace OpenDDS {
39 namespace DCPS {
40 
42  public QOS_XML_Handler
43  {
44  public:
45  /// Pass an optional @error_handler which is called back when
46  /// there are any errors parsing the input XML. The QOS_XML_String_Handler
47  /// will assume ownership when a pointer is passed
48  explicit QOS_XML_String_Handler(XML::XML_Error_Handler* error_handler = 0);
49 
51 
52  /**
53  * The init method will open the file and will validate
54  * it against the schema. It returns RETCODE_ERROR
55  * when any error occurs during parsing
56  */
58  init(const ACE_TCHAR * membuf);
59 
60  /**
61  * add_search_path will add a relative path to the XML
62  * parsing library. The XML parsing library will use
63  * this path to search for the schema
64  */
65  void
66  add_search_path(const ACE_TCHAR *environment,
67  const ACE_TCHAR *relpath);
68 
69  private:
70  /// Schema resolver
72 
73  /// Error handler
74  XML::XML_Error_Handler * eh_;
75 
76  /// Parser
77  XERCES_CPP_NAMESPACE::XercesDOMParser * parser_;
78 
79  /// Final DOMDocument that should be passed to
80  /// dds::reader::dds method
81  XERCES_CPP_NAMESPACE::DOMDocument * finalDoc_;
82  };
83 }
84 }
85 
87 
88 #include /**/ "ace/post.h"
89 
90 #endif /* DCPS_CONFIG_XML_STRING_INTF_H */
XERCES_CPP_NAMESPACE::DOMDocument * finalDoc_
XERCES_CPP_NAMESPACE::XercesDOMParser * parser_
Parser.
char ACE_TCHAR
XML::XML_Schema_Resolver< XML::Environment_Resolver > * res_
Schema resolver.
int init(void)
#define OpenDDS_XML_QOS_Handler_Export
XML::XML_Error_Handler * eh_
Error handler.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28