source: NonGTP/Xerces/xerces-c_2_8_0/include/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp @ 2674

Revision 2674, 3.6 KB checked in by mattausch, 16 years ago (diff)
Line 
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: InMemMsgLoader.hpp 568078 2007-08-21 11:43:25Z amassari $
20 */
21
22
23#if !defined(INMEMMSGLOADER_HPP)
24#define INMEMMSGLOADER_HPP
25
26#include <xercesc/util/XercesDefs.hpp>
27#include <xercesc/util/XMLMsgLoader.hpp>
28
29XERCES_CPP_NAMESPACE_BEGIN
30
31//
32//  This is a simple in memory message loader implementation. For those
33//  folks who just want a single language and want something very fast and
34//  efficient, can basically just provide a couple of arrays of Unicode
35//  strings that can be looked up by the message id.
36//
37class XMLUTIL_EXPORT InMemMsgLoader : public XMLMsgLoader
38{
39public :
40    // -----------------------------------------------------------------------
41    //  Public Constructors and Destructor
42    // -----------------------------------------------------------------------
43    InMemMsgLoader(const XMLCh* const msgDomain);
44    ~InMemMsgLoader();
45
46
47    // -----------------------------------------------------------------------
48    //  Implementation of the virtual message loader API
49    // -----------------------------------------------------------------------
50    virtual bool loadMsg
51    (
52        const   XMLMsgLoader::XMLMsgId  msgToLoad
53        ,       XMLCh* const            toFill
54        , const unsigned int            maxChars
55    );
56
57    virtual bool loadMsg
58    (
59        const   XMLMsgLoader::XMLMsgId  msgToLoad
60        ,       XMLCh* const            toFill
61        , const unsigned int            maxChars
62        , const XMLCh* const            repText1
63        , const XMLCh* const            repText2 = 0
64        , const XMLCh* const            repText3 = 0
65        , const XMLCh* const            repText4 = 0
66        , MemoryManager* const          manager  = XMLPlatformUtils::fgMemoryManager
67    );
68
69    virtual bool loadMsg
70    (
71        const   XMLMsgLoader::XMLMsgId  msgToLoad
72        ,       XMLCh* const            toFill
73        , const unsigned int            maxChars
74        , const char* const             repText1
75        , const char* const             repText2 = 0
76        , const char* const             repText3 = 0
77        , const char* const             repText4 = 0
78        , MemoryManager * const         manager  = XMLPlatformUtils::fgMemoryManager
79    );
80
81
82private :
83    // -----------------------------------------------------------------------
84    //  Unimplemented constructors and operators
85    // -----------------------------------------------------------------------
86    InMemMsgLoader();
87    InMemMsgLoader(const InMemMsgLoader&);
88    InMemMsgLoader& operator=(const InMemMsgLoader&);
89
90
91    // -----------------------------------------------------------------------
92    //  Private data members
93    //
94    //  fMsgDomain
95    //      This is the message domain that we are for loading message from.
96    // -----------------------------------------------------------------------
97    XMLCh*  fMsgDomain;
98};
99
100XERCES_CPP_NAMESPACE_END
101
102#endif
Note: See TracBrowser for help on using the repository browser.