Xerces-C++ 3.3.0

XercesDefs.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_XERCESDEFS_HPP)
23#define XERCESC_INCLUDE_GUARD_XERCESDEFS_HPP
24
25// ---------------------------------------------------------------------------
26// The file xerces_hdr_config defines critical configuration information
27// used by the remainder of this file.
28//
29// There are two major configuration files:
30// - xerces_autoconf_config.hpp-- Contains defines that are safe for
31// access through public headers.
32//
33// - config.h -- Contains defines that may conflict
34// with other packages; should only be
35// included by Xerces implementation files.
36//
37// Both of these files are generated through the autoconf/configure process.
38// ---------------------------------------------------------------------------
39
40//
41// If this is an autoconf configured build, we include Xerces_autoconf_config.hpp
42// Otherwise we include a preconfigured config appropriate for the particular
43// platform that the specific makefile should copy over.
44//
45// If the next line generates an error then you haven't run ./configure
46#include <xercesc/util/Xerces_autoconf_config.hpp>
47
48// ---------------------------------------------------------------------------
49// Include the Xerces version information; this is kept in a separate file to
50// make modification simple and obvious. Updates to the version header file
51// ---------------------------------------------------------------------------
52#include <xercesc/util/XercesVersion.hpp>
53
54
55// ---------------------------------------------------------------------------
56// Some general typedefs that are defined for internal flexibility.
57//
58// Note that UTF16Ch is fixed at 16 bits, whereas XMLCh floats in size per
59// platform, to whatever is the native wide char format there. UCS4Ch is
60// fixed at 32 bits. The types we defined them in terms of are defined per
61// compiler, using whatever types are the right ones for them to get these
62// 16/32 bit sizes.
63//
64// ---------------------------------------------------------------------------
65 typedef unsigned char XMLByte;
66 typedef XMLUInt16 UTF16Ch;
67 typedef XMLUInt32 UCS4Ch;
68
69
70// ---------------------------------------------------------------------------
71// Handle boolean. If the platform can handle booleans itself, then we
72// map our boolean type to the native type. Otherwise we create a default
73// one as an int and define const values for true and false.
74//
75// This flag will be set in the per-development environment stuff above.
76// ---------------------------------------------------------------------------
77#if defined(XERCES_NO_NATIVE_BOOL)
78 #ifndef bool
79 typedef int bool;
80 #endif
81 #ifndef true
82 #define true 1
83 #endif
84 #ifndef false
85 #define false 0
86 #endif
87#endif
88
89// ---------------------------------------------------------------------------
90// According to whether the compiler supports L"" type strings, we define
91// the XMLStrL() macro one way or another.
92// ---------------------------------------------------------------------------
93#if defined(XERCES_LSTRSUPPORT)
94#define XMLStrL(str) L##str
95#else
96#define XMLStrL(str) str
97#endif
98
99
100// ---------------------------------------------------------------------------
101// Define namespace symbols if the compiler supports it.
102// ---------------------------------------------------------------------------
103#if defined(XERCES_HAS_CPP_NAMESPACE)
104 #define XERCES_CPP_NAMESPACE_BEGIN namespace XERCES_CPP_NAMESPACE {
105 #define XERCES_CPP_NAMESPACE_END }
106 #define XERCES_CPP_NAMESPACE_USE using namespace XERCES_CPP_NAMESPACE;
107 #define XERCES_CPP_NAMESPACE_QUALIFIER XERCES_CPP_NAMESPACE::
108
109 namespace XERCES_CPP_NAMESPACE { }
110 namespace xercesc = XERCES_CPP_NAMESPACE;
111#else
112 #define XERCES_CPP_NAMESPACE_BEGIN
113 #define XERCES_CPP_NAMESPACE_END
114 #define XERCES_CPP_NAMESPACE_USE
115 #define XERCES_CPP_NAMESPACE_QUALIFIER
116#endif
117
118#if defined(XERCES_STD_NAMESPACE)
119 #define XERCES_USING_STD(NAME) using std :: NAME;
120 #define XERCES_STD_QUALIFIER std ::
121#else
122 #define XERCES_USING_STD(NAME)
123 #define XERCES_STD_QUALIFIER
124#endif
125
126
127// ---------------------------------------------------------------------------
128// Set up the import/export keyword for our core projects. The
129// PLATFORM_XXXX keywords are set in the per-development environment
130// include above.
131// ---------------------------------------------------------------------------
132
133// The DLL_EXPORT flag should be defined on the command line during the build of a DLL
134// configure conspires to make this happen.
135
136#if defined(DLL_EXPORT)
137 #if defined(XERCES_BUILDING_LIBRARY)
138 #define XMLUTIL_EXPORT XERCES_PLATFORM_EXPORT
139 #define XMLPARSER_EXPORT XERCES_PLATFORM_EXPORT
140 #define SAX_EXPORT XERCES_PLATFORM_EXPORT
141 #define SAX2_EXPORT XERCES_PLATFORM_EXPORT
142 #define CDOM_EXPORT XERCES_PLATFORM_EXPORT
143 #define PARSERS_EXPORT XERCES_PLATFORM_EXPORT
144 #define VALIDATORS_EXPORT XERCES_PLATFORM_EXPORT
145 #define XINCLUDE_EXPORT XERCES_PLATFORM_EXPORT
146 #else
147 #define XMLUTIL_EXPORT XERCES_PLATFORM_IMPORT
148 #define XMLPARSER_EXPORT XERCES_PLATFORM_IMPORT
149 #define SAX_EXPORT XERCES_PLATFORM_IMPORT
150 #define SAX2_EXPORT XERCES_PLATFORM_IMPORT
151 #define CDOM_EXPORT XERCES_PLATFORM_IMPORT
152 #define PARSERS_EXPORT XERCES_PLATFORM_IMPORT
153 #define VALIDATORS_EXPORT XERCES_PLATFORM_IMPORT
154 #define XINCLUDE_EXPORT XERCES_PLATFORM_IMPORT
155 #endif
156 #if defined(XERCES_BUILDING_DEPRECATED_LIBRARY)
157 #define DEPRECATED_DOM_EXPORT XERCES_PLATFORM_EXPORT
158 #else
159 #define DEPRECATED_DOM_EXPORT XERCES_PLATFORM_IMPORT
160 #endif
161#else
162 #define XMLUTIL_EXPORT
163 #define XMLPARSER_EXPORT
164 #define SAX_EXPORT
165 #define SAX2_EXPORT
166 #define CDOM_EXPORT
167 #define DEPRECATED_DOM_EXPORT
168 #define PARSERS_EXPORT
169 #define VALIDATORS_EXPORT
170 #define XINCLUDE_EXPORT
171#endif
172
173#endif
XMLByte
unsigned char XMLByte
Definition XercesDefs.hpp:65
UTF16Ch
XMLUInt16 UTF16Ch
Definition XercesDefs.hpp:66
UCS4Ch
XMLUInt32 UCS4Ch
Definition XercesDefs.hpp:67
Xerces_autoconf_config.hpp
XMLUInt16
uint16_t XMLUInt16
Definition Xerces_autoconf_config.hpp:125
XMLUInt32
uint32_t XMLUInt32
Definition Xerces_autoconf_config.hpp:126
XERCES_CPP_NAMESPACE
Definition DOMAttr.hpp:28