summaryrefslogtreecommitdiff
path: root/modules/CIAO/tools/Config_Handlers/Utils/XML_Schema_Resolver.h
blob: f4573fe20cccf5c5f2746337ca69911a0d8cc976 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
 * @file XML_Schema_Resolver.h
 * @author Will Otte <wotte@dre.vanderbilt.edu>
 *
 * $Id$
 *
 * Resolves schema locations.
 */

#ifndef CIAO_CONFIG_HANDLERS_XML_SCHEAM_RESOLVER_H
#define CIAO_CONFIG_HANDLERS_XML_SCHEAM_RESOLVER_H
#include /**/ "ace/pre.h"

#include "CIAO_XML_Utils_Export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include <xercesc/dom/DOMEntityResolver.hpp>
#include <xercesc/dom/DOMInputSource.hpp>

#include <string>

using xercesc::DOMEntityResolver;
using xercesc::DOMInputSource;

namespace CIAO
{
  namespace Config_Handlers
  {
    /**
     * @class CIAO_Schema_Resolver
     * @brief Resolves schema locations for CIAO.
     */
    class CIAO_Schema_Resolver
      : public virtual DOMEntityResolver
    {
    public:
      /// This constructor locates the schema in the default location
      /// from CIAO_ROOT/docs/schema.
      CIAO_Schema_Resolver (void);

      /// If this constructor is passed a nonempty string, it locates
      /// the schema in that path, otherwise its behavior is the same
      /// as the default constructor.
      CIAO_Schema_Resolver (const char *path);

      /// This function is called by the Xerces infrastructure to
      /// actually resolve the location of a schema.
      virtual DOMInputSource * resolveEntity (const XMLCh *const publicId,
                                              const XMLCh *const systemId,
                                              const XMLCh *const baseURI);

    private:
      std::string resolve_from_environment (void);

      std::string base_path_;
    };
  }
}


#include /**/ "ace/post.h"

#endif /*  CIAO_CONFIG_HANDLERS_XML_SCHEAM_RESOLVER_H */