From 7d6a4d04342f66306e9ed33110591230c04284c9 Mon Sep 17 00:00:00 2001 From: jkinnebrew Date: Fri, 12 Jun 2009 17:37:42 +0000 Subject: Fri Jun 12 17:37:05 UTC 2009 John S. Kinnebrew --- SA_POP/ChangeLog | 21 +- .../XML_Utils/Utils/CIAO_XML_Utils_Export.h | 58 ----- SA_POP/Standalone/XML_Utils/Utils/Exceptions.h | 39 ---- SA_POP/Standalone/XML_Utils/Utils/Utils.mpc | 22 -- .../XML_Utils/Utils/XML_Error_Handler.cpp | 72 ------- .../Standalone/XML_Utils/Utils/XML_Error_Handler.h | 65 ------ SA_POP/Standalone/XML_Utils/Utils/XML_Helper.cpp | 240 --------------------- SA_POP/Standalone/XML_Utils/Utils/XML_Helper.h | 93 -------- .../XML_Utils/Utils/XML_Schema_Resolver.cpp | 55 ----- .../XML_Utils/Utils/XML_Schema_Resolver.h | 66 ------ SA_POP/Standalone/XML_Utils/Utils/XercesString.cpp | 144 ------------- SA_POP/Standalone/XML_Utils/Utils/XercesString.h | 73 ------- 12 files changed, 20 insertions(+), 928 deletions(-) delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/CIAO_XML_Utils_Export.h delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/Exceptions.h delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/Utils.mpc delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/XML_Error_Handler.cpp delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/XML_Error_Handler.h delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/XML_Helper.cpp delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/XML_Helper.h delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/XML_Schema_Resolver.cpp delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/XML_Schema_Resolver.h delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/XercesString.cpp delete mode 100644 SA_POP/Standalone/XML_Utils/Utils/XercesString.h diff --git a/SA_POP/ChangeLog b/SA_POP/ChangeLog index 5e0bfff2443..dcd52e2f43e 100644 --- a/SA_POP/ChangeLog +++ b/SA_POP/ChangeLog @@ -1,3 +1,22 @@ +Fri Jun 12 17:37:05 UTC 2009 John S. Kinnebrew + + + * Standalone/XML_Utils/Utils: + * Standalone/XML_Utils/Utils/CIAO_XML_Utils_Export.h: + * Standalone/XML_Utils/Utils/Exceptions.h: + * Standalone/XML_Utils/Utils/Utils.mpc: + * Standalone/XML_Utils/Utils/XML_Error_Handler.h: + * Standalone/XML_Utils/Utils/XML_Error_Handler.cpp: + * Standalone/XML_Utils/Utils/XML_Helper.h: + * Standalone/XML_Utils/Utils/XML_Helper.cpp: + * Standalone/XML_Utils/Utils/XML_Schema_Resolver.h: + * Standalone/XML_Utils/Utils/XML_Schema_Resolver.cpp: + * Standalone/XML_Utils/Utils/XercesString.h: + * Standalone/XML_Utils/Utils/XercesString.cpp: + + Removed these files for CIAO XML Utilities update. + + Thu Jun 11 20:02:58 UTC 2009 John S. Kinnebrew * common/RACE_common.mpc: @@ -119,7 +138,7 @@ Wed May 27 23:44:58 UTC 2009 William R. Otte * examples/Space/source/common/Event_Types.mpc: * server/Driver.mpc: - Updates for new CIAO. + Updates for new CIAO. Fri Mar 20 23:10:39 UTC 2009 Daniel L.C. Mack diff --git a/SA_POP/Standalone/XML_Utils/Utils/CIAO_XML_Utils_Export.h b/SA_POP/Standalone/XML_Utils/Utils/CIAO_XML_Utils_Export.h deleted file mode 100644 index b322da0a591..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/CIAO_XML_Utils_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl CIAO_XML_Utils -// ------------------------------ -#ifndef CIAO_XML_UTILS_EXPORT_H -#define CIAO_XML_UTILS_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_XML_UTILS_HAS_DLL) -# define CIAO_XML_UTILS_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_XML_UTILS_HAS_DLL */ - -#if !defined (CIAO_XML_UTILS_HAS_DLL) -# define CIAO_XML_UTILS_HAS_DLL 1 -#endif /* ! CIAO_XML_UTILS_HAS_DLL */ - -#if defined (CIAO_XML_UTILS_HAS_DLL) && (CIAO_XML_UTILS_HAS_DLL == 1) -# if defined (CIAO_XML_UTILS_BUILD_DLL) -# define CIAO_XML_Utils_Export ACE_Proper_Export_Flag -# define CIAO_XML_UTILS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_XML_UTILS_BUILD_DLL */ -# define CIAO_XML_Utils_Export ACE_Proper_Import_Flag -# define CIAO_XML_UTILS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_XML_UTILS_BUILD_DLL */ -#else /* CIAO_XML_UTILS_HAS_DLL == 1 */ -# define CIAO_XML_Utils_Export -# define CIAO_XML_UTILS_SINGLETON_DECLARATION(T) -# define CIAO_XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_XML_UTILS_HAS_DLL == 1 */ - -// Set CIAO_XML_UTILS_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_XML_UTILS_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_XML_UTILS_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_XML_UTILS_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_XML_UTILS_NTRACE */ - -#if (CIAO_XML_UTILS_NTRACE == 1) -# define CIAO_XML_UTILS_TRACE(X) -#else /* (CIAO_XML_UTILS_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_XML_UTILS_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_XML_UTILS_NTRACE == 1) */ - -#endif /* CIAO_XML_UTILS_EXPORT_H */ - -// End of auto generated file. diff --git a/SA_POP/Standalone/XML_Utils/Utils/Exceptions.h b/SA_POP/Standalone/XML_Utils/Utils/Exceptions.h deleted file mode 100644 index dadb7ed615d..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/Exceptions.h +++ /dev/null @@ -1,39 +0,0 @@ -// $Id$ -/** - * @file Exceptions.h - * @author William Otte - * - * Defines exceptions that may be thrown during the XSC<=>IDL translation process. - */ -#include - -namespace CIAO -{ - namespace Config_Handlers - { - struct Parse_Error - { - Parse_Error (const std::string &reason) - : reason_ (reason) - { - } - - std::string reason_; - }; - - struct Plan_Error - { - Plan_Error (const std::string &reason) - : reason_ (reason) - { - } - - std::string reason_; - }; - - } -} - - - - diff --git a/SA_POP/Standalone/XML_Utils/Utils/Utils.mpc b/SA_POP/Standalone/XML_Utils/Utils/Utils.mpc deleted file mode 100644 index 4cdf0001d27..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/Utils.mpc +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ - -project (SAPOP_XML_Utils) : acelib, xerces { - - sharedname += SAPOP_XML_Utils - - libout = $(SAPOP_ROOT)/lib - - includes += $(SAPOP_ROOT)/Standalone/XML_Utils \ - $(ACE_ROOT) - - dynamicflags = CIAO_XML_UTILS_BUILD_DLL - - macros += XML_USE_PTHREADS - - Source_Files { - XML_Schema_Resolver.cpp - XML_Error_Handler.cpp - XML_Helper.cpp - XercesString.cpp - } -} diff --git a/SA_POP/Standalone/XML_Utils/Utils/XML_Error_Handler.cpp b/SA_POP/Standalone/XML_Utils/Utils/XML_Error_Handler.cpp deleted file mode 100644 index beae7bce56c..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/XML_Error_Handler.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// $Id$ - -#include "XML_Error_Handler.h" -#include "ace/Log_Msg.h" -#include "ace/Auto_Ptr.h" -#include -#include -#include "XercesString.h" - -using xercesc::XMLString; - -namespace CIAO -{ - namespace Config_Handlers - { - XML_Error_Handler::XML_Error_Handler (void) - : errors_ (false) - { - } - - XML_Error_Handler::~XML_Error_Handler() - { - } - - - bool - XML_Error_Handler::handleError (const DOMError& domError) - { - this->errors_ = true; - - if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING) - ACE_DEBUG ((LM_DEBUG, - "(%P|%t), Warning ")); - else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR) - ACE_DEBUG ((LM_DEBUG, - "(%P|%t), Error ")); - else - ACE_DEBUG ((LM_DEBUG, - "(%P|%t), Fatal Error ")); - char *msg = - XMLString::transcode (domError.getMessage ()); - - ACE_Auto_Basic_Array_Ptr cleanup_msg (msg); - - char *file = - XMLString::transcode (domError.getLocation ()->getURI ()); - - ACE_Auto_Basic_Array_Ptr cleanup_file (file); - - ACE_DEBUG ((LM_DEBUG, - "%s at line %d and column %d in file %s\n", - msg, - domError.getLocation ()->getLineNumber (), - domError.getLocation ()->getColumnNumber (), - file)); - - return true; - } - - void - XML_Error_Handler::resetErrors (void) - { - this->errors_ = false; - } - - bool - XML_Error_Handler::getErrors (void) const - { - return this->errors_; - } - } -} diff --git a/SA_POP/Standalone/XML_Utils/Utils/XML_Error_Handler.h b/SA_POP/Standalone/XML_Utils/Utils/XML_Error_Handler.h deleted file mode 100644 index 1b338de6773..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/XML_Error_Handler.h +++ /dev/null @@ -1,65 +0,0 @@ -//============================================================== -/** - * @file XML_Error_Handler.h - * - * $Id$ - * - * @brief Error handler for Xerces - * - * @author Bala Natarajan - */ -//================================================================ -#ifndef CIAO_CONFIG_HANLDERS_ERROR_HANDLER_H -#define CIAO_CONFIG_HANLDERS_ERROR_HANDLER_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 - -using xercesc::DOMErrorHandler; -using xercesc::DOMError; - -namespace CIAO -{ - namespace Config_Handlers - { - /** - * @class XML_Error_Hander - * - * @brief Error handler for XERCES - * - */ - class XML_Error_Handler - : public DOMErrorHandler - { - public: - - XML_Error_Handler (void); - - ~XML_Error_Handler (void); - - bool handleError (const DOMError& domError); - - void resetErrors (void); - - bool getErrors(void) const; - - private : - // Disallow copying - XML_Error_Handler (const XML_Error_Handler&); - XML_Error_Handler& operator= (const XML_Error_Handler&); - - bool errors_; - }; - } -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_CONFIG_HANLDERS_ERROR_HANDLER_H*/ diff --git a/SA_POP/Standalone/XML_Utils/Utils/XML_Helper.cpp b/SA_POP/Standalone/XML_Utils/Utils/XML_Helper.cpp deleted file mode 100644 index fc9fd07f809..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/XML_Helper.cpp +++ /dev/null @@ -1,240 +0,0 @@ -//$Id$ -#include "XML_Helper.h" -#include "ace/Auto_Ptr.h" -#include "ace/Log_Msg.h" -#include "xercesc/util/XMLUniDefs.hpp" -#include "xercesc/dom/DOM.hpp" -#include "XML_Error_Handler.h" -#include "XML_Schema_Resolver.h" -#include "xercesc/framework/LocalFileFormatTarget.hpp" -#include "XercesString.h" - -namespace CIAO -{ - namespace Config_Handlers - { - using xercesc::XMLException; - using xercesc::XMLString; - using xercesc::DOMImplementation; - using xercesc::DOMImplementationRegistry; - using xercesc::DOMBuilder; - using xercesc::DOMImplementationLS; - using xercesc::XMLUni; - using xercesc::DOMDocument; - using xercesc::DOMException; - - XML_Helper::XML_Helper (void) - : initialized_ (false) - { - this->init_parser (); - } - - XML_Helper::~XML_Helper (void) - { - this->terminate_parser (); - } - - bool - XML_Helper::is_initialized (void) const - { - return this->initialized_ == true; - } - - void - XML_Helper::init_parser (void) - { - if (this->initialized_) - return; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Initializing the Xerces runtime \n")); - // Initialize the Xerces run-time - try - { - xercesc::XMLPlatformUtils::Initialize(); - } - catch (const XMLException& e) - { - char* message = - XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr cleanup_message (message); - - throw; - } - catch (...) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Some other exception," - " returning\n")); - - return; - } - - // Instantiate the DOM parser. - static const XMLCh gLS[] = { xercesc::chLatin_L, - xercesc::chLatin_S, - xercesc::chNull }; - - // Get an implementation of the Load-Store (LS) interface - // and cache it for later use - impl_ = - DOMImplementationRegistry::getDOMImplementation(gLS); - - this->initialized_ = true; - return; - } - - XERCES_CPP_NAMESPACE::DOMDocument * - XML_Helper::create_dom (const ACE_TCHAR *root, - const ACE_TCHAR *ns) - { - if (root == 0 || ns == 0) - return 0; - - return this->impl_->createDocument (XStr (ns), - XStr (root), - 0); - } - - XERCES_CPP_NAMESPACE::DOMDocument * - XML_Helper::create_dom (const ACE_TCHAR *url) - { - - if (url == 0) - return impl_->createDocument( - XStr ("http://www.omg.org/DeploymentPlan"), - XStr ("deploymentPlan"), - 0); - - try - { - - // Create a DOMBuilder - DOMBuilder* parser = - impl_->createDOMBuilder (DOMImplementationLS::MODE_SYNCHRONOUS, - 0); - - // Discard comment nodes in the document - parser->setFeature (XMLUni::fgDOMComments, false); - - // Disable datatype normalization. The XML 1.0 attribute value - // normalization always occurs though. - parser->setFeature (XMLUni::fgDOMDatatypeNormalization, true); - - // Do not create EntityReference nodes in the DOM tree. No - // EntityReference nodes will be created, only the nodes - // corresponding to their fully expanded sustitution text will be - // created. - parser->setFeature (XMLUni::fgDOMEntities, false); - - // Perform Namespace processing. - parser->setFeature (XMLUni::fgDOMNamespaces, true); - - // Perform Validation - parser->setFeature (XMLUni::fgDOMValidation, true); - - // Do not include ignorable whitespace in the DOM tree. - parser->setFeature (XMLUni::fgDOMWhitespaceInElementContent, false); - - // Enable the parser's schema support. - parser->setFeature (XMLUni::fgXercesSchema, true); - - // Enable full schema constraint checking, including checking which - // may be time-consuming or memory intensive. Currently, particle - // unique attribution constraint checking and particle derivation - // restriction checking are controlled by this option. - parser->setFeature (XMLUni::fgXercesSchemaFullChecking, true); - - // The parser will treat validation error as fatal and will exit. - parser->setFeature (XMLUni::fgXercesValidationErrorAsFatal, true); - - XML_Error_Handler handler; - - parser->setErrorHandler (&handler); - - CIAO_Schema_Resolver resolver; - - parser->setEntityResolver (&resolver); - - DOMDocument* doc = parser->parseURI (url); - - if (handler.getErrors ()) - throw 0; - - return doc; - } - catch (const DOMException& e) - { - const unsigned int maxChars = 2047; - XMLCh errText[maxChars + 1]; - - if (DOMImplementation::loadDOMExceptionMsg (e.code, - errText, - maxChars)) - { - char* message = - XMLString::transcode (errText); - ACE_Auto_Basic_Array_Ptr cleanup_message (message); - } - return 0; - - } - catch (const XMLException& e) - { - char* message = XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr cleanup_message (message); - throw 0; - } - catch (...) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Caught an unknown exception \n")); - throw 0; - } - - return 0; - } - - void - XML_Helper::terminate_parser (void) - { - try - { - xercesc::XMLPlatformUtils::Terminate(); - } - catch (const XMLException& e) - { - char* message = - XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr cleanup_message (message); - throw; - } - - this->initialized_ = false; - return; - } - - bool XML_Helper::write_DOM (XERCES_CPP_NAMESPACE::DOMDocument *doc, - const ACE_TCHAR *file) - { - bool retn; - XERCES_CPP_NAMESPACE::DOMWriter *writer = impl_->createDOMWriter(); - - if (writer->canSetFeature (XMLUni::fgDOMWRTFormatPrettyPrint, - true)) - writer->setFeature (XMLUni::fgDOMWRTFormatPrettyPrint, true); - - xercesc::XMLFormatTarget* ft (new xercesc::LocalFileFormatTarget(file)); - retn = writer->writeNode(ft, *doc); - delete writer; - delete ft; - return retn; - } - } -} -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton< CIAO::Config_Handlers::XML_Helper, ACE_Null_Mutex> * -ACE_Singleton::singleton_; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ - - diff --git a/SA_POP/Standalone/XML_Utils/Utils/XML_Helper.h b/SA_POP/Standalone/XML_Utils/Utils/XML_Helper.h deleted file mode 100644 index 718a2b8a761..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/XML_Helper.h +++ /dev/null @@ -1,93 +0,0 @@ -// $Id$ -//============================================================ -/** - * @file XML_Helper.h - * - * @brief Some helper functions for XML - * - * @author Bala Natarajan - */ -//============================================================ -#ifndef CIAO_CONFIG_HANDLERS_XML_HELPER_H -#define CIAO_CONFIG_HANDLERS_XML_HELPER_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 "ace/Singleton.h" -#include "ace/Null_Mutex.h" - -#include "xercesc/util/XercesDefs.hpp" - -namespace XERCES_CPP_NAMESPACE -{ - class DOMDocument; - class DOMWriter; - class DOMImplementation; -} - - -namespace CIAO -{ - namespace Config_Handlers - { - /** - * @class XML_Helper - * - * @brief Helper class for some routine XML stuff. - */ - class CIAO_XML_Utils_Export XML_Helper - { - public: - XML_Helper (void); - - ~XML_Helper (void); - - /// Create a DOM tree - XERCES_CPP_NAMESPACE::DOMDocument * - create_dom (const ACE_TCHAR *uri); - - XERCES_CPP_NAMESPACE::DOMDocument * - create_dom (const ACE_TCHAR *root, - const ACE_TCHAR *ns); - - //Writes out a DOMDocument to an XML file - bool write_DOM (XERCES_CPP_NAMESPACE::DOMDocument *doc, - const ACE_TCHAR *file); - - bool is_initialized (void) const; - - protected: - /// Intialize the parser - void init_parser (void); - - /// Terminate the parser - void terminate_parser (void); - - private: - bool initialized_; - XERCES_CPP_NAMESPACE::DOMImplementation *impl_; - }; - } -} - -CIAO_XML_UTILS_SINGLETON_DECLARE (ACE_Singleton, - CIAO::Config_Handlers::XML_Helper, - ACE_Null_Mutex) -namespace CIAO -{ - namespace Config_Handlers - { - typedef ACE_Singleton < XML_Helper, ACE_Null_Mutex > XML_Helper_Singleton; - } -} - - -#define XML_HELPER CIAO::Config_Handlers::XML_Helper_Singleton::instance () - - -#include /**/ "ace/post.h" -#endif/*CIAO_CONFIG_HANDLERS_XML_HELPER_H*/ diff --git a/SA_POP/Standalone/XML_Utils/Utils/XML_Schema_Resolver.cpp b/SA_POP/Standalone/XML_Utils/Utils/XML_Schema_Resolver.cpp deleted file mode 100644 index 269e95ab425..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/XML_Schema_Resolver.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// $Id$ -#include "XML_Schema_Resolver.h" -#include "XercesString.h" -#include "ace/Env_Value_T.h" -#include -#include - -using xercesc::Wrapper4InputSource; -using xercesc::LocalFileInputSource; - - -namespace CIAO -{ - namespace Config_Handlers - { - CIAO_Schema_Resolver::CIAO_Schema_Resolver (void) - { - this->base_path_ = this->resolve_from_environment (); - } - - CIAO_Schema_Resolver::CIAO_Schema_Resolver (const char *path) - { - if (path == 0) - this->base_path_ = this->resolve_from_environment (); - else - this->base_path_ = path; - } - - /// This function is called by the Xerces infrastructure to - /// actually resolve the location of a schema. - DOMInputSource * - CIAO_Schema_Resolver::resolveEntity (const XMLCh *const publicId, - const XMLCh *const systemId, - const XMLCh *const baseURI) - { - ACE_UNUSED_ARG (baseURI); - ACE_UNUSED_ARG (publicId); - - XStr path (this->base_path_.c_str ()); - path.append (systemId); - - // Ownership of these objects is given to other people. - return new Wrapper4InputSource (new LocalFileInputSource (path)); - } - - std::string - CIAO_Schema_Resolver::resolve_from_environment (void) - { - ACE_Env_Value path ("CIAO_ROOT", ""); - - std::string retval (path); - return retval += "/docs/schema/"; - } - } -} diff --git a/SA_POP/Standalone/XML_Utils/Utils/XML_Schema_Resolver.h b/SA_POP/Standalone/XML_Utils/Utils/XML_Schema_Resolver.h deleted file mode 100644 index f4573fe20cc..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/XML_Schema_Resolver.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file XML_Schema_Resolver.h - * @author Will Otte - * - * $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 -#include - -#include - -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 */ diff --git a/SA_POP/Standalone/XML_Utils/Utils/XercesString.cpp b/SA_POP/Standalone/XML_Utils/Utils/XercesString.cpp deleted file mode 100644 index effb98b6f97..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/XercesString.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// $Id$ - -#include -#include - -#include "XercesString.h" -using xercesc::XMLString; - -namespace CIAO -{ -namespace Config_Handlers -{ - - XStr::XStr (const char* str) - : _wstr(0) - { - _wstr = XMLString::transcode(str); - } - - XStr::XStr (XMLCh *wstr) - : _wstr(wstr) - { - - } - - XStr::XStr (const XMLCh* wstr) - : _wstr(0) - { - _wstr = XMLString::replicate(wstr); - } - - XStr::XStr (const XStr &right) - : _wstr(0) - { - _wstr = XMLString::replicate(right._wstr); - } - - XStr& XStr::operator= (const XStr& rhs) - { - if (&rhs == this) - return *this; - XStr temp (rhs); - std::swap (this->_wstr, temp._wstr); - return *this; - } - - XStr::~XStr () - { - if (_wstr) - XMLString::release(&_wstr); - } - - const XMLCh* XStr::begin () const - { - return _wstr; - } - - const XMLCh* XStr::end () const - { - return _wstr + size(); - } - - bool XStr::append(const XMLCh *tail) - { - int iTailLen = XMLString::stringLen(tail); - int iWorkLen = XMLString::stringLen(_wstr); - XMLCh *result = new XMLCh[ iWorkLen + iTailLen + 1 ]; - bool bOK = result != 0; - if (bOK) - { - XMLCh *target = result; - XMLString::moveChars(target, _wstr, iWorkLen); - target += iWorkLen; - XMLString::moveChars(target, tail, iTailLen); - target += iTailLen; - *target++ = 0; - XMLString::release(&_wstr); - _wstr = result; - } - return bOK; - } - - bool XStr::erase(const XMLCh *head, const XMLCh *tail) - { - bool bOK = head <= tail && head >= begin() && tail <= end(); - if (bOK) - { - XMLCh *result = new XMLCh[ size() - (tail - head) + 1 ]; - XMLCh *target = result; - bOK = target != 0; - if (bOK) - { - const XMLCh *cursor = begin(); - - while (cursor != head) *target++ = *cursor++; - cursor = tail; - while ( cursor != end() ) *target++ = *cursor++; - *target ++ = 0; - XMLString::release(&_wstr); - _wstr = result; - } - } - return bOK; - } - - int XStr::size () const - { - return XMLString::stringLen(_wstr); - } - - XMLCh XStr::operator [] (const int i) - { - return _wstr[i]; - } - - XMLCh XStr::operator [] (const int i) const - { - return _wstr[i]; - } - - bool operator== (const XStr& lhs, const XStr& rhs) - { - return XMLString::compareIString (lhs,rhs) == 0; - } - - bool operator!= (const XStr& lhs, const XStr& rhs) - { - return !operator==(lhs, rhs); - } - - - std::ostream& - operator<< (std::ostream& o, XStr const& str) - { - char* s = XMLString::transcode (str); - - o << s; - - XMLString::release (&s); // idiots? - return o; - } - -} -} diff --git a/SA_POP/Standalone/XML_Utils/Utils/XercesString.h b/SA_POP/Standalone/XML_Utils/Utils/XercesString.h deleted file mode 100644 index e7f0059086b..00000000000 --- a/SA_POP/Standalone/XML_Utils/Utils/XercesString.h +++ /dev/null @@ -1,73 +0,0 @@ -// $Id$ - -#ifndef _XERCESSTRING_H -#define _XERCESSTRING_H - -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include - -#include - -// Utility class that provides a std::string like facade to XMLString. -// Doesn't implement all of the methods of std::string. -#include "CIAO_XML_Utils_Export.h" -namespace CIAO -{ -namespace Config_Handlers -{ - - class CIAO_XML_Utils_Export XStr - { - public: - XStr() : _wstr(0L) { }; - - XStr (const char* str); - - XStr (XMLCh* wstr); - - XStr (const XMLCh* wstr); - - XStr (const XStr& copy); - - XStr& operator= (const XStr& rhs); - - ~XStr(); - - const XMLCh* begin() const; - - const XMLCh* end() const; - - bool append(const XMLCh* tail); - - bool erase (const XMLCh* head, const XMLCh* tail); - - int size() const; - - XMLCh operator [] (const int i); - - XMLCh operator [] (const int i) const; - - operator const XMLCh* () const { return _wstr; }; - - private: - - XMLCh* _wstr; // Internal representation - - }; - - CIAO_XML_Utils_Export bool operator== (const XStr& lhs, const XStr& rhs); - CIAO_XML_Utils_Export bool operator!= (const XStr& lhs, const XStr& rhs); - - CIAO_XML_Utils_Export std::ostream& - operator<< (std::ostream& o, XStr const& str); - -} -} -#include /**/ "ace/post.h" - -#endif /* _XERCESSTRING_H */ -- cgit v1.2.1