Xerces-C++ 3.3.0
LocalFileFormatTarget.hpp
Go to the documentation of this file.
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$
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_LOCALFILEFORMATTARGET_HPP)
23#define XERCESC_INCLUDE_GUARD_LOCALFILEFORMATTARGET_HPP
24
26
28
30public:
31
35 (
36 const XMLCh* const
38 );
39
41 (
42 const char* const
44 );
45
48
49 // -----------------------------------------------------------------------
50 // Implementations of the format target interface
51 // -----------------------------------------------------------------------
52 virtual void writeChars(const XMLByte* const toWrite
53 , const XMLSize_t count
54 , XMLFormatter* const formatter);
55
56 virtual void flush();
57
58private:
59 // -----------------------------------------------------------------------
60 // Unimplemented methods.
61 // -----------------------------------------------------------------------
64
65 // -----------------------------------------------------------------------
66 // Private helpers
67 // -----------------------------------------------------------------------
68 void ensureCapacity(const XMLSize_t extraNeeded);
69
70 // -----------------------------------------------------------------------
71 // Private data members
72 //
73 // fSource
74 // The source file that we represent. The FileHandle type is defined
75 // per platform.
76 //
77 // fDataBuf
78 // The pointer to the buffer data. Its always
79 // one larger than fCapacity, to leave room for the null terminator.
80 //
81 // fIndex
82 // The current index into the buffer, as characters are appended
83 // to it. If its zero, then the buffer is empty.
84 //
85 // fCapacity
86 // The current capacity of the buffer. Its actually always one
87 // larger, to leave room for the null terminator.
88 // -----------------------------------------------------------------------
89 FileHandle fSource;
90 XMLByte* fDataBuf;
91 XMLSize_t fIndex;
92 XMLSize_t fCapacity;
93 MemoryManager* fMemoryManager;
94};
95
96
98
99#endif
XERCES_CPP_NAMESPACE_BEGIN typedef void * FileHandle
Definition XMLFileMgr.hpp:30
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
unsigned char XMLByte
Definition XercesDefs.hpp:65
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
size_t XMLSize_t
Definition Xerces_autoconf_config.hpp:112
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
Definition LocalFileFormatTarget.hpp:29
LocalFileFormatTarget(const XMLCh *const, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
virtual void writeChars(const XMLByte *const toWrite, const XMLSize_t count, XMLFormatter *const formatter)
LocalFileFormatTarget(const char *const, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
virtual void flush()
Configurable memory manager.
Definition MemoryManager.hpp:40
Definition XMLFormatter.hpp:443
This class provides the basic formatting capabilities that are required to turn the Unicode based XML...
Definition XMLFormatter.hpp:42
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121