Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / XML_Utils / XML_Schema_Resolver.tpp
blob3b5a68b5d082f89a7ad0376a1154ccb7c0c396e2
1 #ifndef XML_SCHEMA_RESOLVER_TPP
2 #define XML_SCHEMA_RESOLVER_TPP
4 #include "XML_Schema_Resolver.h"
5 #include "XercesString.h"
7 #include <xercesc/framework/LocalFileInputSource.hpp>
8 #include <xercesc/framework/Wrapper4InputSource.hpp>
10 using xercesc::Wrapper4InputSource;
11 using xercesc::LocalFileInputSource;
14 namespace XML
16   template<typename Resolver>
17   XML_Schema_Resolver<Resolver>::XML_Schema_Resolver (void)
18     : resolver_ ()
19   {
20   }
22   template<typename Resolver>
23   XML_Schema_Resolver<Resolver>::XML_Schema_Resolver (Resolver &res)
24     : resolver_ (res)
25   {
26   }
28   template<typename Resolver>
29   Resolver &
30   XML_Schema_Resolver<Resolver>::get_resolver (void)
31   {
32     return resolver_;
33   }
35   /// This function is called by the Xerces infrastructure to
36   /// actually resolve the location of a schema.
37   template<typename Resolver>
38   InputSource *
39   XML_Schema_Resolver<Resolver>::resolveEntity (const XMLCh *const publicId,
40                                                   const XMLCh *const systemId)
41   {
42     XStr path = resolver_ (publicId, systemId);
43     if (path.begin () == 0)
44       return 0;
46     // Ownership of these objects is given to other people.
47     return /*new Wrapper4InputSource*/ (new LocalFileInputSource (path.begin ()));
48   }
51 #endif /*XML_SCHEMA_RESOLVER_TPP*/