OpenDDS  Snapshot(2023/04/28-20:55)
XML_File_Intf.h
Go to the documentation of this file.
1 //==============================================================
2 /**
3  * @file XML_File_Intf.h
4  *
5  *
6  * @author Marcel Smit (msmit@remedy.nl)
7  * @author Danilo C. Zanella (dczanella@gmail.com)
8  */
9 //================================================================
10 
11 #ifndef OPENDDS_DCPS_QOS_XML_HANDLER_XML_FILE_INTF_H
12 #define OPENDDS_DCPS_QOS_XML_HANDLER_XML_FILE_INTF_H
13 #include /**/ "ace/pre.h"
14 
15 #if !defined (ACE_LACKS_PRAGMA_ONCE)
16 # pragma once
17 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 
19 #include "dds_qos.hpp"
20 #include "XML_Intf.h"
21 #include "dds/DdsDcpsInfrastructureC.h"
22 #include "ace/XML_Utils/XML_Helper.h"
24 
25 namespace XML
26 {
27  struct Environment_Resolver;
28  template <typename Resolver>
30  class XML_Error_Handler;
31 }
32 
34 
35 namespace OpenDDS {
36 namespace DCPS {
37 
39  public QOS_XML_Handler
40  {
41  public:
42  /// Pass an optional @error_handler which is called back when
43  /// there are any errors parsing the input XML. The QOS_XML_File_Handler
44  /// will assume ownership when a pointer is passed
45  explicit QOS_XML_File_Handler(XML::XML_Error_Handler* error_handler = 0);
46 
48 
49  /**
50  * The init method will open the file and will validate
51  * it against the schema. It returns RETCODE_ERROR
52  * when any error occurs during parsing
53  */
54  DDS::ReturnCode_t init(const ACE_TCHAR * file);
55 
56  /**
57  * add_search_path will add a relative path to the XML
58  * parsing library. The XML parsing library will use
59  * this path to search for the schema
60  */
61  void
62  add_search_path(const ACE_TCHAR *environment,
63  const ACE_TCHAR *relpath);
64 
65  private:
67  typedef XML::XML_Helper<XML_RESOLVER, XML::XML_Error_Handler> XML_HELPER;
68 
69  /// Schema resolver
70  XML_RESOLVER *res_;
71 
72  /// Error handler
73  XML::XML_Error_Handler *eh_;
74 
75  /// XML Helper
76  XML_HELPER helper_;
77  };
78 }
79 }
80 
82 
83 #include /**/ "ace/post.h"
84 
85 #endif /* DCPS_CONFIG_XML_FILE_INTF_H */
XML::XML_Schema_Resolver< XML::Environment_Resolver > XML_RESOLVER
Definition: XML_File_Intf.h:66
char ACE_TCHAR
XML_RESOLVER * res_
Schema resolver.
Definition: XML_File_Intf.h:70
int init(void)
XML_HELPER helper_
XML Helper.
Definition: XML_File_Intf.h:76
XML::XML_Helper< XML_RESOLVER, XML::XML_Error_Handler > XML_HELPER
Definition: XML_File_Intf.h:67
#define OpenDDS_XML_QOS_Handler_Export
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
XML::XML_Error_Handler * eh_
Error handler.
Definition: XML_File_Intf.h:73