From 8e306af51d44dd14ff27dc548aeab6af48aac683 Mon Sep 17 00:00:00 2001
From: PeiYong Zhang <peiyongz@apache.org>
Date: Thu, 12 Dec 2002 16:29:30 +0000
Subject: [PATCH] loadAMsgSet() added

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174506 13f79535-47bb-0310-9956-ffa450edef68
---
 .../Platforms/Tandem/TandemPlatformUtils.cpp  | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/src/xercesc/util/Platforms/Tandem/TandemPlatformUtils.cpp b/src/xercesc/util/Platforms/Tandem/TandemPlatformUtils.cpp
index a2d8681b3..e50044b67 100644
--- a/src/xercesc/util/Platforms/Tandem/TandemPlatformUtils.cpp
+++ b/src/xercesc/util/Platforms/Tandem/TandemPlatformUtils.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.4  2002/12/12 16:29:30  peiyongz
+ * loadAMsgSet() added
+ *
  * Revision 1.3  2002/11/04 15:13:01  tng
  * C++ Namespace Support.
  *
@@ -101,6 +104,14 @@
 #include    <sys/timeb.h>
 #include    <string.h>
 
+#if defined (XML_USE_ICU_MESSAGELOADER)
+    #include <xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp>
+#elif defined (XML_USE_ICONV_MESSAGELOADER)
+    #include <xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.hpp>
+#else   // use In-memory message loader
+    #include <xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp>
+#endif
+
 XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
@@ -110,6 +121,30 @@ void XMLPlatformUtils::platformInit()
 {
 }
 
+//
+//  This method is called by the platform independent part of this class
+//  when client code asks to have one of the supported message sets loaded.
+//  In our case, we use the ICU based message loader mechanism.
+//
+XMLMsgLoader* XMLPlatformUtils::loadAMsgSet(const XMLCh* const msgDomain)
+{
+    XMLMsgLoader* retVal;
+    try
+    {
+#if defined (XML_USE_ICU_MESSAGELOADER)
+        retVal = new ICUMsgLoader(msgDomain);
+#elif defined (XML_USE_ICONV_MESSAGELOADER)
+        retVal = new MsgCatalogLoader(msgDomain);
+#else
+        retVal = new InMemMsgLoader(msgDomain);
+#endif
+    }
+    catch(...)
+    {
+        panic(XMLPlatformUtils::Panic_CantLoadMsgDomain);
+    }
+    return retVal;
+}
 
 // ---------------------------------------------------------------------------
 //  XMLPlatformUtils: File Methods
-- 
GitLab