1 | /*
|
---|
2 | * Copyright 2002-2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #if !defined(XERCESVERSION_HPP)
|
---|
18 | #define XERCESVERSION_HPP
|
---|
19 |
|
---|
20 | // ---------------------------------------------------------------------------
|
---|
21 | // X E R C E S V E R S I O N H E A D E R D O C U M E N T A T I O N
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * User Documentation for Xerces Version Values:
|
---|
25 | *
|
---|
26 | *
|
---|
27 | *
|
---|
28 | * Xerces Notes:
|
---|
29 | *
|
---|
30 | * Xerces Committers Documentation:
|
---|
31 | *
|
---|
32 | * Xerces committers normally only need to modify one or two of the
|
---|
33 | * following macros:
|
---|
34 | *
|
---|
35 | * XERCES_VERSION_MAJOR
|
---|
36 | * XERCES_VERSION_MINOR
|
---|
37 | * XERCES_VERSION_REVISION
|
---|
38 | *
|
---|
39 | * The integer values of these macros define the Xerces version number. All
|
---|
40 | * other constants and preprocessor macros are automatically generated from
|
---|
41 | * these three definitions.
|
---|
42 | *
|
---|
43 | * The macro XERCES_GRAMMAR_SERIALIZATION_LEVEL has been added so that during
|
---|
44 | * development if users are using the latest code they can use the grammar
|
---|
45 | * serialization/desialization features. Whenever a change is made to the
|
---|
46 | * serialization code this macro should be incremented.
|
---|
47 | *
|
---|
48 | * Xerces User Documentation:
|
---|
49 | *
|
---|
50 | * The following sections in the user documentation have examples based upon
|
---|
51 | * the following three version input values:
|
---|
52 | *
|
---|
53 | * #define XERCES_VERSION_MAJOR 19
|
---|
54 | * #define XERCES_VERSION_MINOR 3
|
---|
55 | * #define XERCES_VERSION_REVISION 74
|
---|
56 | *
|
---|
57 | * The minor and revision (patch level) numbers have two digits of resolution
|
---|
58 | * which means that '3' becomes '03' in this example. This policy guarantees
|
---|
59 | * that when using preprocessor macros, version 19.3.74 will be greater than
|
---|
60 | * version 1.94.74 since the first will expand to 190374 and the second to
|
---|
61 | * 19474.
|
---|
62 | *
|
---|
63 | * Preprocessor Macros:
|
---|
64 | *
|
---|
65 | * _XERCES_VERSION defines the primary preprocessor macro that users will
|
---|
66 | * introduce into their code to perform conditional compilation where the
|
---|
67 | * version of Xerces is detected in order to enable or disable version
|
---|
68 | * specific capabilities. The value of _XERCES_VERSION for the above example
|
---|
69 | * will be 190374. To use it a user would perform an operation such as the
|
---|
70 | * following:
|
---|
71 | *
|
---|
72 | * #if _XERCES_VERSION >= 190374
|
---|
73 | * // code specific to new version of Xerces...
|
---|
74 | * #else
|
---|
75 | * // old code here...
|
---|
76 | * #endif
|
---|
77 | *
|
---|
78 | * XERCES_FULLVERSIONSTR is a preprocessor macro that expands to a string
|
---|
79 | * constant whose value, for the above example, will be "19_3_74".
|
---|
80 | *
|
---|
81 | * XERCES_FULLVERSIONDOT is a preprocessor macro that expands to a string
|
---|
82 | * constant whose value, for the above example, will be "19.3.74".
|
---|
83 | *
|
---|
84 | * XERCES_VERSIONSTR is a preprocessor macro that expands to a string
|
---|
85 | * constant whose value, for the above example, will be "19_3". This
|
---|
86 | * particular macro is very dangerous if it were to be used for comparing
|
---|
87 | * version numbers since ordering will not be guaranteed.
|
---|
88 | *
|
---|
89 | * Xerces_DLLVersionStr is a preprocessor macro that expands to a string
|
---|
90 | * constant whose value, for the above example, will be "19_3_74". This
|
---|
91 | * macro is provided for backwards compatibility to pre-1.7 versions of
|
---|
92 | * Xerces.
|
---|
93 | *
|
---|
94 | * String Constants:
|
---|
95 | *
|
---|
96 | * gXercesVersionStr is a global string constant whose value corresponds to
|
---|
97 | * the value "19_3" for the above example.
|
---|
98 | *
|
---|
99 | * gXercesFullVersionStr is a global string constant whose value corresponds
|
---|
100 | * to the value "19_3_74" for the above example.
|
---|
101 | *
|
---|
102 | * Numeric Constants:
|
---|
103 | *
|
---|
104 | * gXercesMajVersion is a global integer constant whose value corresponds to
|
---|
105 | * the major version number. For the above example its value will be 19.
|
---|
106 | *
|
---|
107 | * gXercesMinVersion is a global integer constant whose value corresponds to
|
---|
108 | * the minor version number. For the above example its value will be 3.
|
---|
109 | *
|
---|
110 | * gXercesRevision is a global integer constant whose value corresponds to
|
---|
111 | * the revision (patch) version number. For the above example its value will
|
---|
112 | * be 74.
|
---|
113 | *
|
---|
114 | */
|
---|
115 |
|
---|
116 | // ---------------------------------------------------------------------------
|
---|
117 | // X E R C E S V E R S I O N S P E C I F I C A T I O N
|
---|
118 |
|
---|
119 | /**
|
---|
120 | * MODIFY THESE NUMERIC VALUES TO COINCIDE WITH XERCES VERSION
|
---|
121 | * AND DO NOT MODIFY ANYTHING ELSE IN THIS VERSION HEADER FILE
|
---|
122 | */
|
---|
123 |
|
---|
124 | #define XERCES_VERSION_MAJOR 2
|
---|
125 | #define XERCES_VERSION_MINOR 6
|
---|
126 | #define XERCES_VERSION_REVISION 0
|
---|
127 |
|
---|
128 | /***
|
---|
129 | * data member added to XSAnnotation
|
---|
130 | ***/
|
---|
131 | #define XERCES_GRAMMAR_SERIALIZATION_LEVEL 3
|
---|
132 |
|
---|
133 | /** DO NOT MODIFY BELOW THIS LINE */
|
---|
134 |
|
---|
135 | /**
|
---|
136 | * MAGIC THAT AUTOMATICALLY GENERATES THE FOLLOWING:
|
---|
137 | *
|
---|
138 | * Xerces_DLLVersionStr, gXercesVersionStr, gXercesFullVersionStr,
|
---|
139 | * gXercesMajVersion, gXercesMinVersion, gXercesRevision
|
---|
140 | */
|
---|
141 |
|
---|
142 | // ---------------------------------------------------------------------------
|
---|
143 | // T W O A R G U M E N T C O N C A T E N A T I O N M A C R O S
|
---|
144 |
|
---|
145 | // two argument concatenation routines
|
---|
146 | #define CAT2_SEP_UNDERSCORE(a, b) #a "_" #b
|
---|
147 | #define CAT2_SEP_PERIOD(a, b) #a "." #b
|
---|
148 | #define CAT2_SEP_NIL(a, b) #a #b
|
---|
149 | #define CAT2_RAW_NUMERIC(a, b) a ## b
|
---|
150 |
|
---|
151 | // two argument macro invokers
|
---|
152 | #define INVK_CAT2_SEP_UNDERSCORE(a,b) CAT2_SEP_UNDERSCORE(a,b)
|
---|
153 | #define INVK_CAT2_SEP_PERIOD(a,b) CAT2_SEP_PERIOD(a,b)
|
---|
154 | #define INVK_CAT2_STR_SEP_NIL(a,b) CAT2_SEP_NIL(a,b)
|
---|
155 | #define INVK_CAT2_RAW_NUMERIC(a,b) CAT2_RAW_NUMERIC(a,b)
|
---|
156 |
|
---|
157 | // ---------------------------------------------------------------------------
|
---|
158 | // T H R E E A R G U M E N T C O N C A T E N A T I O N M A C R O S
|
---|
159 |
|
---|
160 | // three argument concatenation routines
|
---|
161 | #define CAT3_SEP_UNDERSCORE(a, b, c) #a "_" #b "_" #c
|
---|
162 | #define CAT3_SEP_PERIOD(a, b, c) #a "." #b "." #c
|
---|
163 | #define CAT3_SEP_NIL(a, b, c) #a #b #c
|
---|
164 | #define CAT3_RAW_NUMERIC(a, b, c) a ## b ## c
|
---|
165 | #define CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a, b, c) a ## _ ## b ## _ ## c
|
---|
166 |
|
---|
167 | // three argument macro invokers
|
---|
168 | #define INVK_CAT3_SEP_UNDERSCORE(a,b,c) CAT3_SEP_UNDERSCORE(a,b,c)
|
---|
169 | #define INVK_CAT3_SEP_PERIOD(a,b,c) CAT3_SEP_PERIOD(a,b,c)
|
---|
170 | #define INVK_CAT3_SEP_NIL(a,b,c) CAT3_SEP_NIL(a,b,c)
|
---|
171 | #define INVK_CAT3_RAW_NUMERIC(a,b,c) CAT3_RAW_NUMERIC(a,b,c)
|
---|
172 | #define INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c) CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c)
|
---|
173 |
|
---|
174 | // ---------------------------------------------------------------------------
|
---|
175 | // C A L C U L A T E V E R S I O N - E X P A N D E D F O R M
|
---|
176 |
|
---|
177 | #define MULTIPLY(factor,value) factor * value
|
---|
178 | #define CALC_EXPANDED_FORM(a,b,c) ( MULTIPLY(10000,a) + MULTIPLY(100,b) + MULTIPLY(1,c) )
|
---|
179 |
|
---|
180 | // ---------------------------------------------------------------------------
|
---|
181 | // X E R C E S V E R S I O N I N F O R M A T I O N
|
---|
182 |
|
---|
183 | // Xerces version strings; these particular macros cannot be used for
|
---|
184 | // conditional compilation as they are not numeric constants
|
---|
185 |
|
---|
186 | #define XERCES_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
|
---|
187 | #define XERCES_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
|
---|
188 | #define XERCES_FULLVERSIONNUM INVK_CAT3_SEP_NIL(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
|
---|
189 | #define XERCES_VERSIONSTR INVK_CAT2_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR)
|
---|
190 |
|
---|
191 | // Xerces C++ Namespace string, concatenated with full version string
|
---|
192 | #define XERCES_PRODUCT xercesc
|
---|
193 | #define XERCES_CPP_NAMESPACE INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(XERCES_PRODUCT,XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR)
|
---|
194 |
|
---|
195 | // original from Xerces header
|
---|
196 | #define Xerces_DLLVersionStr XERCES_FULLVERSIONSTR
|
---|
197 |
|
---|
198 | const char* const gXercesVersionStr = XERCES_VERSIONSTR;
|
---|
199 | const char* const gXercesFullVersionStr = XERCES_FULLVERSIONSTR;
|
---|
200 | const unsigned int gXercesMajVersion = XERCES_VERSION_MAJOR;
|
---|
201 | const unsigned int gXercesMinVersion = XERCES_VERSION_MINOR;
|
---|
202 | const unsigned int gXercesRevision = XERCES_VERSION_REVISION;
|
---|
203 |
|
---|
204 | // Xerces version numeric constants that can be used for conditional
|
---|
205 | // compilation purposes.
|
---|
206 |
|
---|
207 | #define _XERCES_VERSION CALC_EXPANDED_FORM (XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
|
---|
208 |
|
---|
209 | #endif // XERCESVERSION_HPP
|
---|