[2674] | 1 | /* |
---|
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
| 3 | * contributor license agreements. See the NOTICE file distributed with |
---|
| 4 | * this work for additional information regarding copyright ownership. |
---|
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
| 6 | * (the "License"); you may not use this file except in compliance with |
---|
| 7 | * the License. You may obtain a copy of the License at |
---|
| 8 | * |
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 10 | * |
---|
| 11 | * Unless required by applicable law or agreed to in writing, software |
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 14 | * See the License for the specific language governing permissions and |
---|
| 15 | * limitations under the License. |
---|
| 16 | */ |
---|
| 17 | |
---|
| 18 | /* |
---|
| 19 | * $Id: MsgLoader.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | #if !defined(ICONVMSGLOADER_HPP) |
---|
| 23 | #define ICONVMSGLOADER_HPP |
---|
| 24 | |
---|
| 25 | #include <xercesc/util/XercesDefs.hpp> |
---|
| 26 | #include <xercesc/util/XMLMsgLoader.hpp> |
---|
| 27 | |
---|
| 28 | #include <nl_types.h> |
---|
| 29 | |
---|
| 30 | XERCES_CPP_NAMESPACE_BEGIN |
---|
| 31 | |
---|
| 32 | // |
---|
| 33 | // This is a simple in Iconv RC message loader implementation. |
---|
| 34 | // |
---|
| 35 | class XMLUTIL_EXPORT MsgCatalogLoader : public XMLMsgLoader |
---|
| 36 | { |
---|
| 37 | public : |
---|
| 38 | // ----------------------------------------------------------------------- |
---|
| 39 | // Public Constructors and Destructor |
---|
| 40 | // ----------------------------------------------------------------------- |
---|
| 41 | MsgCatalogLoader(const XMLCh* const msgDomain); |
---|
| 42 | ~MsgCatalogLoader(); |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | // ----------------------------------------------------------------------- |
---|
| 46 | // Implementation of the virtual message loader API |
---|
| 47 | // ----------------------------------------------------------------------- |
---|
| 48 | virtual bool loadMsg |
---|
| 49 | ( |
---|
| 50 | const XMLMsgLoader::XMLMsgId msgToLoad |
---|
| 51 | , XMLCh* const toFill |
---|
| 52 | , const unsigned int maxChars |
---|
| 53 | ); |
---|
| 54 | |
---|
| 55 | virtual bool loadMsg |
---|
| 56 | ( |
---|
| 57 | const XMLMsgLoader::XMLMsgId msgToLoad |
---|
| 58 | , XMLCh* const toFill |
---|
| 59 | , const unsigned int maxChars |
---|
| 60 | , const XMLCh* const repText1 |
---|
| 61 | , const XMLCh* const repText2 = 0 |
---|
| 62 | , const XMLCh* const repText3 = 0 |
---|
| 63 | , const XMLCh* const repText4 = 0 |
---|
| 64 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
| 65 | ); |
---|
| 66 | |
---|
| 67 | virtual bool loadMsg |
---|
| 68 | ( |
---|
| 69 | const XMLMsgLoader::XMLMsgId msgToLoad |
---|
| 70 | , XMLCh* const toFill |
---|
| 71 | , const unsigned int maxChars |
---|
| 72 | , const char* const repText1 |
---|
| 73 | , const char* const repText2 = 0 |
---|
| 74 | , const char* const repText3 = 0 |
---|
| 75 | , const char* const repText4 = 0 |
---|
| 76 | , MemoryManager * const manager = XMLPlatformUtils::fgMemoryManager |
---|
| 77 | ); |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | private : |
---|
| 81 | // ----------------------------------------------------------------------- |
---|
| 82 | // Unimplemented constructors and operators |
---|
| 83 | // ----------------------------------------------------------------------- |
---|
| 84 | MsgCatalogLoader(); |
---|
| 85 | MsgCatalogLoader(const MsgCatalogLoader&); |
---|
| 86 | MsgCatalogLoader& operator=(const MsgCatalogLoader&); |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | // ----------------------------------------------------------------------- |
---|
| 90 | // Private data members |
---|
| 91 | // |
---|
| 92 | // fModHandle |
---|
| 93 | // This is our DLL module handle that we need in order to load |
---|
| 94 | // resource messages. This is set during construction. |
---|
| 95 | // |
---|
| 96 | // fMsgDomain |
---|
| 97 | // This is the name of the error domain that this loader is for. |
---|
| 98 | // ----------------------------------------------------------------------- |
---|
| 99 | nl_catd fCatalogHandle; |
---|
| 100 | XMLCh* fMsgDomain; |
---|
| 101 | |
---|
| 102 | }; |
---|
| 103 | |
---|
| 104 | XERCES_CPP_NAMESPACE_END |
---|
| 105 | |
---|
| 106 | #endif |
---|